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

fullsend-ai/fullsend

Measured 16 November 2026, 14:56 UTC, at code version c095e16

First survey, so nothing to compare with yet Code coverage: not measured

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 66.3out of 100 At risk

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 217,533 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 5.1 person-years · Weakest lens: Security and Compliance, 61.2

Findings by how serious they are

34 critical 2296 serious 112 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 14:56 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

62of 62 dimensions measured by tools.
2411of 2442 findings point to an exact file and line, so you can open each one in the code. The other 31 concern the repository as a whole, such as missing documentation.
62dimensions across 6 lenses, read from 217,533 lines of product code in 5 projects.
Chapters

Executive summary

fullsend-ai/fullsend is rated At risk because critical security findings are open. Its score is held back because it has pipeline tools referenced by a changeable name and packages with a known security hole. It scores 66.3 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Security and Compliance, at 61.2, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 2.4 points. Replacing the three passwords or keys found in the code's history comes next, worth about 1.2 points. Raising Security and Compliance to 68 would lift the score to about 68.5.

Thirteen known security holes in the packages the code depends on can be used by attackers. Five passwords or keys are open to anyone who can read the repository, and four settings leave the servers or containers unsafe. Updating the vulnerable packages, replacing each exposed password or key and correcting the unsafe settings would close these risks. Pinning each tool to an exact version would fix the two pipeline tools referenced by a changeable name, and limiting each secret to its own step would deal with the two secrets exposed to more of the pipeline than needed.

The product code is 217,533 lines, about €740,000 to rebuild.

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

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

If Security and Compliance rose from 61.2 to 68, the lowest score rated Strong, the score would rise from 66.3 to about 68.5.

Code composition: what the lines of code are
Product code 36%Tests 64%
Rebuild cost: about €740,000 · Estimate
Cost to rebuild€250,000 to €1,200,000, for 4,093 to 12,985 hours of work, about 5.1 person-years for 3 to 10 engineers
Difficulty of the problemStandard, 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 66. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 217,533 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 2.4 points · Medium effort · Keyboard semantics
2
Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED.
Raises the score by about 1.2 points · Low effort · Secrets (history)
3
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.
Raises the score by about 1.2 points · Low effort · Supply-chain Provenance & Signing

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €740,000 to build again, about 5.1 person-years of work. Its weakest lens is Security and Compliance, at 61.2 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 2.4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 702,219 lines over the last 90 days, which is about 2,847,888 lines a year. At that pace, the extra work comes to an estimated 509 to 3053.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch github.com/fullsend-ai/fullsend fullsend github.com/fullsend-ai/fullsend/internal/mintcore mintcore github.com/fullsend-ai/fullsend->github.com/fullsend-ai/fullsend/internal/mintcore github.com/fullsend-ai/fullsend/cmd/mint mint github.com/fullsend-ai/fullsend/cmd/mint->github.com/fullsend-ai/fullsend/internal/mintcore github.com/fullsend-ai/fullsend/cmd/mint-wasm mint-wasm github.com/fullsend-ai/fullsend/cmd/mint-wasm->github.com/fullsend-ai/fullsend/internal/mintcore github.com/fullsend-ai/fullsend/internal/mint mint github.com/fullsend-ai/fullsend/internal/mint->github.com/fullsend-ai/fullsend/internal/mintcore

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.

113 modules, with 158 dependencies between them. 2 loops run through 5 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 73 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 cloudflare_site.worker.src2 github.com/fullsend-ai/fullsend/internal/behaviourfail3 github.com/fullsend-ai/fullsend/internal/config4 github.com/fullsend-ai/fullsend/internal/dispatch5 github.com/fullsend-ai/fullsend/internal/fetch6 github.com/fullsend-ai/fullsend/internal/gitfetch7 github.com/fullsend-ai/fullsend/internal/gitlabroles8 github.com/fullsend-ai/fullsend/internal/mintcore9 github.com/fullsend-ai/fullsend/internal/normevent10 github.com/fullsend-ai/fullsend/internal/ui11 github.com/fullsend-ai/fullsend/internal/botidentity12 github.com/fullsend-ai/fullsend/internal/e2eauth13 github.com/fullsend-ai/fullsend/internal/jirapoll14 github.com/fullsend-ai/fullsend/internal/forge15 github.com/fullsend-ai/fullsend/internal/appsetup16 github.com/fullsend-ai/fullsend/internal/forge/github17 github.com/fullsend-ai/fullsend/internal/harness18 github.com/fullsend-ai/fullsend/internal/poll19 github.com/fullsend-ai/fullsend/internal/repos20 github.com/fullsend-ai/fullsend/internal/sticky21 github.com/fullsend-ai/fullsend/internal/tracker22 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/ci23 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/scm24 github.com/fullsend-ai/fullsend/internal/e2etest25 github.com/fullsend-ai/fullsend/internal/fetchsvc26 github.com/fullsend-ai/fullsend/internal/forge/gitlab27 github.com/fullsend-ai/fullsend/internal/forge/jira28 github.com/fullsend-ai/fullsend/internal/harnessdispatch29 github.com/fullsend-ai/fullsend/internal/layers30 github.com/fullsend-ai/fullsend/internal/resolve31 github.com/fullsend-ai/fullsend/internal/security32 github.com/fullsend-ai/fullsend/internal/statuscomment33 github.com/fullsend-ai/fullsend/internal/gitlablifecycle34 github.com/fullsend-ai/fullsend/internal/jiradispatch35 github.com/fullsend-ai/fullsend/internal/runtime36 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/install37 github.com/fullsend-ai/fullsend/internal/cli38 github.com/fullsend-ai/fullsend/pkg/behaviourtest/world39 github.com/fullsend-ai/fullsend/pkg/behaviourtest40 github.com/fullsend-ai/fullsend/pkg/behaviourtest/steps
1 cloudflare_site.worker.src
2 github.com/fullsend-ai/fullsend/internal/behaviourfail
3 github.com/fullsend-ai/fullsend/internal/config
4 github.com/fullsend-ai/fullsend/internal/dispatch
5 github.com/fullsend-ai/fullsend/internal/fetch
6 github.com/fullsend-ai/fullsend/internal/gitfetch
7 github.com/fullsend-ai/fullsend/internal/gitlabroles
8 github.com/fullsend-ai/fullsend/internal/mintcore
9 github.com/fullsend-ai/fullsend/internal/normevent
10 github.com/fullsend-ai/fullsend/internal/ui
11 github.com/fullsend-ai/fullsend/internal/botidentity1
12 github.com/fullsend-ai/fullsend/internal/e2eauth10
13 github.com/fullsend-ai/fullsend/internal/jirapoll216
14 github.com/fullsend-ai/fullsend/internal/forge21
15 github.com/fullsend-ai/fullsend/internal/appsetup24
16 github.com/fullsend-ai/fullsend/internal/forge/github143
17 github.com/fullsend-ai/fullsend/internal/harness3122
18 github.com/fullsend-ai/fullsend/internal/poll623
19 github.com/fullsend-ai/fullsend/internal/repos161937
20 github.com/fullsend-ai/fullsend/internal/sticky12
21 github.com/fullsend-ai/fullsend/internal/tracker317
22 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/ci3
23 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/scm5
24 github.com/fullsend-ai/fullsend/internal/e2etest11
25 github.com/fullsend-ai/fullsend/internal/fetchsvc222
26 github.com/fullsend-ai/fullsend/internal/forge/gitlab457
27 github.com/fullsend-ai/fullsend/internal/forge/jira12
28 github.com/fullsend-ai/fullsend/internal/harnessdispatch2242
29 github.com/fullsend-ai/fullsend/internal/layers131
30 github.com/fullsend-ai/fullsend/internal/resolve113
31 github.com/fullsend-ai/fullsend/internal/security2
32 github.com/fullsend-ai/fullsend/internal/statuscomment25
33 github.com/fullsend-ai/fullsend/internal/gitlablifecycle24284
34 github.com/fullsend-ai/fullsend/internal/jiradispatch222
35 github.com/fullsend-ai/fullsend/internal/runtime4934
36 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/install192
37 github.com/fullsend-ai/fullsend/internal/cli281223463315111130191671257217
38 github.com/fullsend-ai/fullsend/pkg/behaviourtest/world1131121
39 github.com/fullsend-ai/fullsend/pkg/behaviourtest3111131
40 github.com/fullsend-ai/fullsend/pkg/behaviourtest/steps113126721117
Uses a module listed above itPart of a loopThe module itself
1 cloudflare_site.worker.src2 github.com/fullsend-ai/fullsend/internal/behaviourfail3 github.com/fullsend-ai/fullsend/internal/config4 github.com/fullsend-ai/fullsend/internal/dispatch5 github.com/fullsend-ai/fullsend/internal/fetch6 github.com/fullsend-ai/fullsend/internal/gitfetch7 github.com/fullsend-ai/fullsend/internal/gitlabroles8 github.com/fullsend-ai/fullsend/internal/mintcore9 github.com/fullsend-ai/fullsend/internal/normevent10 github.com/fullsend-ai/fullsend/internal/ui11 github.com/fullsend-ai/fullsend/internal/botidentity12 github.com/fullsend-ai/fullsend/internal/e2eauth13 github.com/fullsend-ai/fullsend/internal/jirapoll14 github.com/fullsend-ai/fullsend/internal/forge15 github.com/fullsend-ai/fullsend/internal/appsetup16 github.com/fullsend-ai/fullsend/internal/forge/github17 github.com/fullsend-ai/fullsend/internal/harness18 github.com/fullsend-ai/fullsend/internal/poll19 github.com/fullsend-ai/fullsend/internal/repos20 github.com/fullsend-ai/fullsend/internal/sticky21 github.com/fullsend-ai/fullsend/internal/tracker22 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/ci23 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/scm24 github.com/fullsend-ai/fullsend/internal/e2etest25 github.com/fullsend-ai/fullsend/internal/fetchsvc26 github.com/fullsend-ai/fullsend/internal/forge/gitlab27 github.com/fullsend-ai/fullsend/internal/forge/jira28 github.com/fullsend-ai/fullsend/internal/harnessdispatch29 github.com/fullsend-ai/fullsend/internal/layers30 github.com/fullsend-ai/fullsend/internal/resolve31 github.com/fullsend-ai/fullsend/internal/security32 github.com/fullsend-ai/fullsend/internal/statuscomment33 github.com/fullsend-ai/fullsend/internal/gitlablifecycle34 github.com/fullsend-ai/fullsend/internal/jiradispatch35 github.com/fullsend-ai/fullsend/internal/runtime36 github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/install37 github.com/fullsend-ai/fullsend/internal/cli38 github.com/fullsend-ai/fullsend/pkg/behaviourtest/world39 github.com/fullsend-ai/fullsend/pkg/behaviourtest40 github.com/fullsend-ai/fullsend/pkg/behaviourtest/stepscloudflare_site.worker.src1github.com/fullsend-ai/fullsend/internal/behaviourfail2github.com/fullsend-ai/fullsend/internal/config3github.com/fullsend-ai/fullsend/internal/dispatch4github.com/fullsend-ai/fullsend/internal/fetch5github.com/fullsend-ai/fullsend/internal/gitfetch6github.com/fullsend-ai/fullsend/internal/gitlabroles7github.com/fullsend-ai/fullsend/internal/mintcore8github.com/fullsend-ai/fullsend/internal/normevent9github.com/fullsend-ai/fullsend/internal/ui10github.com/fullsend-ai/fullsend/internal/botidentity11github.com/fullsend-ai/fullsend/internal/e2eauth12github.com/fullsend-ai/fullsend/internal/jirapoll13github.com/fullsend-ai/fullsend/internal/forge14github.com/fullsend-ai/fullsend/internal/appsetup15github.com/fullsend-ai/fullsend/internal/forge/github16github.com/fullsend-ai/fullsend/internal/harness17github.com/fullsend-ai/fullsend/internal/poll18github.com/fullsend-ai/fullsend/internal/repos19github.com/fullsend-ai/fullsend/internal/sticky20github.com/fullsend-ai/fullsend/internal/tracker21github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/ci22github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/scm23github.com/fullsend-ai/fullsend/internal/e2etest24github.com/fullsend-ai/fullsend/internal/fetchsvc25github.com/fullsend-ai/fullsend/internal/forge/gitlab26github.com/fullsend-ai/fullsend/internal/forge/jira27github.com/fullsend-ai/fullsend/internal/harnessdispatch28github.com/fullsend-ai/fullsend/internal/layers29github.com/fullsend-ai/fullsend/internal/resolve30github.com/fullsend-ai/fullsend/internal/security31github.com/fullsend-ai/fullsend/internal/statuscomment32github.com/fullsend-ai/fullsend/internal/gitlablifecycle33github.com/fullsend-ai/fullsend/internal/jiradispatch34github.com/fullsend-ai/fullsend/internal/runtime35github.com/fullsend-ai/fullsend/pkg/behaviourtest/drivers/install36github.com/fullsend-ai/fullsend/internal/cli37github.com/fullsend-ai/fullsend/pkg/behaviourtest/world38github.com/fullsend-ai/fullsend/pkg/behaviourtest39github.com/fullsend-ai/fullsend/pkg/behaviourtest/steps401102162124143312262316193712317351122245712224213111322524284222493419228122346331511113019167125721711311213111131113126721117+73 more modules (most-connected shown)

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

At a glance — Architecture · 93.3 · Exemplary ·

At a glance — Maturity · 79.7 · Strong ·

At a glance — Readiness · 86.5 · Adequate · gated by D11 ·

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

At a glance — Accessibility · 63.1 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures30High / Critical
A05:2025 — Injection29High / Critical
A07:2025 — Authentication Failures6High / Critical
A02:2025 — Security Misconfiguration5High / Critical

Roadmap

Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1; Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.4 ptsMediumKeyboard semantics
Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED.+1.2 ptsLowSecrets (history)
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.2 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.2 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.2 ptsLowSupply-chain Provenance & Signing
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+2.1 ptsMediumVisual & motion safety
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+2.1 ptsMediumPage structure
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED, REDACTED.+1.0 ptsLowSecrets (history)

File quality

Per-file score 0–10 — a quality signature. Of 349 files carrying findings, judged against the Preview bar: 0% slop · 7% mixed · 93% near-clean.

FileScoreBandWorst signal
REDACTED1.6SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.0MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.6MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedSecrets (history): REDACTED: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
internal/dispatch/gcf/gcp.go5.5MixedCyclomatic Complexity: LiveGCFClient.GetServiceRevisionInfo (cyclomatic 32)
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.8MixedIaC & Container Security: Critical IaC: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 34

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

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

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

Could not be resolved — 17

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

Methodology & how to trust this report

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

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

What we checked — 62 dimensions across the health lenses
D1D2D3D4D5D6D7D10D11D12D13D14D15D16D17D20D21D22D23D26D27D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX6M1M2M3M4P1P10P11P2P3P4P6P7X14X19X2X26X27X28X3X30

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e4dc-03fa-7b9c-96e0-ed691a9499d6.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 287 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 829 test source file(s) (.py, .go) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D25 ADR Conformance — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The code index reads C#, Razor, TypeScript, JavaScript and Vue. A rule whose scope holds production code in another language is not called honoured, because its uses could sit in that code.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Go, 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.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Go, 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 50 further occurrence(s) are not listed individually; the score already reflects all 90.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust 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.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust 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.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 292 further occurrence(s) are not listed individually; the score already reflects all 332.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax 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, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's 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: 10 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

448 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was cli.runAgent at 469. A further 2 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being repos.initialDistributionEligible at 21 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: internal/telemetry/telemetry.go (telemetry.isTokenChar at 18). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

cli.runAgent (cyclomatic 469)internal/cli/run.go:493
repos.rotateOneRole (cyclomatic 163)internal/repos/gitlab_roles_rotate.go:354
cli.runReposInstall (cyclomatic 154)internal/cli/repos.go:604
cli.resolveFromLock (cyclomatic 149)internal/cli/lock.go:944
Poller.Run (cyclomatic 139)internal/poll/poll.go:74

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

What to do

  1. Bring the 18 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with cli.runAgent (cyclomatic 469), repos.rotateOneRole (cyclomatic 163), cli.runReposInstall (cyclomatic 154). — 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 18 together lifts Cyclomatic Complexity from 2.0 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

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

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

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

669 method(s) exceeded the cognitive complexity threshold of 15; the worst was cli.runAgent at 830.

LiveClient.ListOrgRepos (cognitive 17) · ×2REDACTED:1173
Driver.AssertNoWorkflow (cognitive 16) · ×2pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:325
cli.runAgent (cognitive 830)internal/cli/run.go:493
cli.runReposInstall (cognitive 278)internal/cli/repos.go:604
cli.resolveFromLock (cognitive 228)internal/cli/lock.go:944

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

What to do

  1. Bring the 61 bodies over 60 down to 60 or less in Cognitive Complexity — start with cli.runAgent (cognitive 830), cli.runReposInstall (cognitive 278), cli.resolveFromLock (cognitive 228). — 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 61 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.

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

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.

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

140 god class(es) detected.

FileTooLong: cli/run.go · ×53internal/cli/run.go
FunctionTooLong: cli.runAgent · ×38internal/cli/run.go:493
TooManyMethods: LiveClient · ×17internal/forge/gitlab/gitlab.go:24
ClassTooLong: LiveClient · ×13REDACTED:46
MethodTooLong: Poller.Run · ×13internal/poll/poll.go:74

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

What to do

  1. Resolve the 53 FileTooLong finding(s) in God Classes — start with REDACTED (3), provisioner.go (2), gitlabci.go (2). — One of this dimension's main actionable groups (53 warning-level).
  2. Resolve the 38 FunctionTooLong finding(s) in God Classes — start with converge.go (5), mint.go (3), compose.go (3). — One of this dimension's main actionable groups (38 warning-level).
  3. Resolve the 17 TooManyMethods finding(s) in God Classes — start with REDACTED (2), REDACTED (2), gitlab.go. — One of this dimension's main actionable groups (17 warning-level).

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

D4 · Code Duplication6.6 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

427 duplicated block group(s) detected. 8.4 % of the production lines (18,319 of 217,533) are in a reported copy. A further 303 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 7 of the 730 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (7 lines × 2) · ×51internal/cli/admin.go:764
Duplicated block (8 lines × 2) · ×37internal/cli/postcomment.go:60
Duplicated block (9 lines × 2) · ×35internal/artifacts/measurements.go:32
Duplicated block (10 lines × 2) · ×29internal/celtrigger/celtrigger.go:65
Duplicated block (12 lines × 2) · ×28internal/artifacts/prepare.go:153

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

What to do

  1. Resolve the 51 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (9), gcp.go (5), compose.go (3). — One of this dimension's main actionable groups (51 warning-level).
  2. Resolve the 37 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with ci.go (3), REDACTED (2), compose.go (2). — One of this dimension's main actionable groups (37 warning-level).
  3. Resolve the 35 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with run.go (3), converge.go (3), mint.go (2). — One of this dimension's main actionable groups (35 warning-level).

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

D5 · Coupling8.4 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

5 production modules (Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: github.com/fullsend-ai/fullsend/internal/mintcore

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

1 of 173 classes have LCOM4 above 3.

Low cohesion: LiveGCFClient (LCOM4 20)internal/dispatch/gcf/gcp.go:226

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with gcp.go. — One of this dimension's main actionable groups (1 warning-level).

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

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

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

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

Detailed fixes: d7_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

8 skipped (8 with a documented reason), 0 zero-assertion, 4 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 287 tests. Measured on the JavaScript/TypeScript suite only — at least 829 test source file(s) (.py, .go) went unread, so its test quality is unmeasured and is not in these counts.

Fixed-sleep synchronisation: run: an abort while the child is running terminates it · ×4internal/runtime/pi_extension/fullsend-agent.test.mjs:1127
Skipped (documented): run: a timed-out child gets SIGTERM, so its detached grandchildren die with it · ×8internal/runtime/pi_extension/fullsend-agent.test.mjs:604

What to do

  1. Resolve the 4 Fixed-sleep synchronisation finding(s) in Test Quality — start with fullsend-agent.test.mjs (4). — One of this dimension's main actionable groups (4 warning-level).

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

D11 · Test Reliability2.0 / 10Critical✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

4 flaky across 2 measured tier(s). JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in the repository root (106 tests); vitest via `npm ci --ignore-scripts` in internal/dispatch/cf/workersrc/ (0 tests)): measured (0 flaky); Go (4 modules): measured (4 flaky).

Flaky test: .::github.com/fullsend-ai/fullsend/internal/cli.TestLoadAppSetPEMs_BadDir · ×4

What to do

  1. Resolve the 4 Flaky test finding(s) in Test Reliability. — One of this dimension's main actionable groups (4 issue-level).

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

D12 · Dependency Hygiene9.3 / 10Exemplary✓ Tool-verified

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

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

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

15 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 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/cucumber/gherkin/go/v42 · ×15

✓ On the Gold path — maintain.

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

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

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

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

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

REDACTED scan ran and found no leaked secrets. 4 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 65 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 1 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (64 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 6 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum) and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots7.6 / 10Strong✓ Tool-verified

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

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

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

Top hotspots: internal/cli/run.go (295×469=138355); internal/cli/repos.go (93×154=14322); internal/repos/converge.go (81×122=9882) Repeated repair below the complexity floor: REDACTED (30 of 57 changes were fixes); internal/runtime/env_data.go (15 of 15 changes were fixes); internal/runtime/event.go (14 of 21 changes were fixes)

Hotspot: internal/cli/run.go · ×154internal/cli/run.go:493
Repeated repair: REDACTED · ×56REDACTED:1004

What to do

  1. Resolve the 154 Hotspot finding(s) in Churn × Complexity Hotspots — start with run.go (3), dispatch.go (3), REDACTED (2). — One of this dimension's main actionable groups (154 warning-level).
  2. Resolve the 56 Repeated repair finding(s) in Churn × Complexity Hotspots — start with owners.go (2), REDACTED, env_data.go. — One of this dimension's main actionable groups (56 warning-level).

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

D16 · Bus Factor8.7 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

48 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is internal/repos/gitlab_webhook.go. Counted over 388 of the 573 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)

What to do

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

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

D17 · Explicit Debt10.0 / 10Stronggated by 5 serious findings✓ Tool-verified

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

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

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

5 deducted task-comment markers across 217533 LoC (0.0/KLoC) → score 10.0. 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 · ×5pkg/behaviourtest/select.go:69

What to do

  1. Resolve the 5 TodoComment finding(s) in Explicit Debt — start with run.go (3), select.go (2). — One of this dimension's main actionable groups (5 warning-level).

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

D20 · ADR Quality9.8 / 10Exemplary✓ Tool-verified

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

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

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

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

ADR superseded but its status says otherwise · ×7docs/ADRs/0061-harness-cel-dispatch.md:3detected by adr-integrity

✓ On the Gold path — maintain.

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

D21 · Naming Consistency6.5 / 10Adequate✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

2 naming inconsistencies among 57 declarations measured against a convention their peers follow.

`appSlugRE` spells `RE` where 55 names in the project spell it `Re`internal/cli/mint_setup.go:211
`varExpressionRE` spells `RE` where 55 names in the project spell it `Re`internal/repos/openai_wif.go:550

What to do

  1. Resolve the 1 `appSlugRE` spells `RE` where 55 names in the project spell it `Re` finding(s) in Naming Consistency — start with mint_setup.go. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `varExpressionRE` spells `RE` where 55 names in the project spell it… finding(s) in Naming Consistency — start with openai_wif.go. — One of this dimension's main actionable groups (1 recommendation-level).

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

D22 · Internal API Consistency10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the internal API surface is consistent and coherent.

Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.

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

0 API inconsistencies among 291 exposed members measured against a convention their peers follow.

✓ On the Gold path — maintain.

Detailed fixes: d22_recommendation.md.

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

No domain types leak across context boundaries (3 contexts). Contexts: cli, poll, runtime.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D26 · Project Cohesion6.0 / 10Adequate✓ Tool-verified

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

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

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

1 of 5 build units (Go, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionpackage.json:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with package.json. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability8.2 / 10Strong✓ Tool-verified

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

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

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

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

56 % of calls cross a namespace and 10 % go through an interface, but 51 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Scattered collaborators

What to do

  1. Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)5.0 / 10Adequate✓ Tool-verified

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

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

29 finding(s): 0 critical, 7 high, 22 medium, 0 low. 2 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 26 file(s) — `e2e/org-pool/lib.sh`, `hack/ci-local/fetch` (lines 4–14), `hack/ci-local/sumof` (lines 5–16), `hack/clean-stale-branches`, `hack/gitlab-runner-vm/create-gcp-vm.sh`, … (+21 more) — 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 6 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 2 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (2 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.6 / 10Critical✓ Tool-verified

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

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

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

27 finding(s): 1 critical, 12 high, 13 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 12 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11), REDACTED. — One of this dimension's main actionable groups (12 issue-level).
  2. Resolve the 11 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED (2). — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D31 · IaC & Container Security7.9 / 10Adequategated by 4 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 Critical IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 388 of the 573 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. 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.

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

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 6 platform declaration(s) and 1 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC3 · Page structure5.2 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — web/public/index.html:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — web/public/index.html:857

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics4.3 / 10Weak✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. — docs/.vitepress/theme/components/Mermaid.vue:80

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety5.0 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.result` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/.vitepress/theme/components/VPLocalSearchBox.vue:834
  • `.reading-progress` moves (`transition: width 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/.vitepress/theme/custom.css:236

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.7 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `PerRepoConfigReader` declares 22 methods: `ConfigRoles`, `ConfigRuntime`, `ConfigForge`, `ConfigTracker`, `ConfigMintURL`, `ConfigMintURLFromFile`, `ConfigKeepHistory`, `ConfigInferenceProvider`, `ConfigInferenceProject`, `ConfigInferenceRegion`, `ConfigInferenceWIFProvider`, `ConfigInferenceWIFAudience`, `ConfigInferenceServiceAccount`, `ConfigInferenceOpenAI`, `ConfigInferenceGateway`, `ConfigModelAliases`, `ConfigArtifactsContent`, `ConfigArtifactsContentSet`, `ConfigArtifactsBySource`, `IsOwnersFileAuthEnabled`, `JiraAuthorization`, `TraceContext`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/config/interfaces.go:62
  • `PerRepoConfigWriter` declares 16 methods: `SetRoles`, `SetRuntime`, `SetMintURL`, `SetKeepHistory`, `SetInferenceProvider`, `SetInferenceProject`, `SetInferenceRegion`, `SetInferenceWIFProvider`, `SetInferenceWIFAudience`, `SetInferenceServiceAccount`, `SetInferenceOpenAI`, `SetInferenceGateway`, `MergeInferenceGateway`, `SetModelAliases`, `SetOwnersFileAuthEnabled`, `SetIssueTracking`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/config/interfaces.go:133
  • `GCFClient` declares 32 methods: `CreateServiceAccount`, `DeleteServiceAccount`, `CreateWIFPool`, `DeleteWIFPool`, `CreateWIFProvider`, `GetWIFProvider`, `UpdateWIFProvider`, `DisableWIFProvider`, `DeleteWIFProvider`, `GetSecret`, `CreateSecret`, `AddSecretVersion`, `AccessSecretVersion`, `DisableSecretVersion`, `EnableSecretVersion`, `DeleteSecret`, `SetSecretIAMBinding`, `ReplaceSecretIAMBinding`, `SetProjectIAMBinding`, `SetCloudRunInvoker`, `DeleteFunction`, `GetFunction`, `GetCloudRunServiceURI`, `UploadFunctionSource`, `CreateFunction`, `UpdateFunction`, `UpdateFunctionEnvVars`, `UpdateServiceEnvVars`, `GetServiceRevisionInfo`, `GetServiceTrafficEnvVars`, `WaitForOperation`, `GetProjectNumber`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/dispatch/gcf/gcp.go:146
  • `Client` declares 129 methods: `ListOrgRepos`, `GetRepo`, `CreateRepo`, `UpdateRepoVisibility`, `DeleteRepo`, `FindExistingFork`, `CreateFork`, `CreateForkInOrg`, `DeleteProjectServiceAccount`, `CreateFile`, `CreateOrUpdateFile`, `GetFileContent`, `UpdateFileIfMatch`, `DeleteFile`, `DeleteFiles`, `ListDirectoryContents`, `ListRepositoryFiles`, `GetFileContentAtRef`, `CommitFiles`, `CommitFilesToBranch`, `ForceCommitFileToBranch`, `GetRef`, `GetBranchRef`, `CreateBranch`, `CreateBranchFromSHA`, `DeleteBranch`, `DeleteRef`, `CreateFileOnBranch`, `CreateOrUpdateFileOnBranch`, `CreateChangeProposal`, `CreateCrossRepoChangeProposal`, `ListRepoPullRequests`, `CloseChangeProposal`, `GetOrgPlan`, `GetAuthenticatedUser`, `GetAuthenticatedUserIdentity`, `GetTokenScopes`, `IsInstallationToken`, `CreateRepoSecret`, `RepoSecretExists`, and 89 more. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — REDACTED:1040
  • `GitLabClient` declares 22 methods: `ListIssuesUpdatedSince`, `ListMergeRequestsUpdatedSince`, `ListProjectEvents`, `ListIssueNotes`, `ListMergeRequestNotes`, `ListMergeRequestDiffVersions`, `ListResourceLabelEvents`, `GetFileContentAtRef`, `GetBranchRef`, `CommitFileToBranch`, `ForceCommitFileToBranch`, `DeleteRef`, `GetAuthenticatedUser`, `GetAuthenticatedUserID`, `GetUserBot`, `CreateNoteAwardEmoji`, `GetIssue`, `GetMergeRequest`, `GetMemberAccessLevel`, `GetProjectPath`, `CreatePipelineWithInputs`, `CreateChildPipelineWithInputs`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/poll/client.go:24
  • `GitLabTriggerAccountAPI` declares 22 methods: `GetAuthenticatedUserID`, `ListProjectServiceAccounts`, `CreateProjectServiceAccount`, `DeleteProjectServiceAccount`, `GetProjectMemberAccessLevel`, `AddProjectMember`, `UpdateProjectMemberAccessLevel`, `CreateServiceAccountPAT`, `ListServiceAccountPATs`, `RevokeServiceAccountPAT`, `HasExactProtectedBranchRule`, `GrantProtectedBranchPushDeployKey`, `ProtectedBranchPushDeployKeyEntryID`, `RevokeProtectedBranchPushDeployKeyEntry`, `ListProjectDeployKeys`, `DeleteProjectDeployKey`, `ListPipelineTriggerTokens`, `RevokePipelineTriggerToken`, `AccountSSHKeyIDs`, `AccountActiveJobIDs`, `AccountScheduleIDs`, `UnknownOwnerScheduleIDs`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/repos/gitlab_trigger_account.go:97
  • `Driver` declares 29 methods: `CreateIssue`, `AddIssueLabels`, `EnsureLabel`, `AddComment`, `GetIssue`, `ListOpenIssues`, `GetFileContent`, `GetFileContentAtRef`, `CommitFile`, `CreateBranch`, `DeleteBranch`, `CommitFileToBranch`, `CreateChangeProposal`, `SubmitPullRequestReview`, `CloseIssue`, `ListOpenChangeProposals`, `ListComments`, `ListIssueReactions`, `CreateRepo`, `EnsureRepoPublic`, `GetDefaultBranch`, `GetBranchRef`, `DeleteRepo`, `CreateFork`, `CreateUserFork`, `CommitFileToFork`, `CreateForkChangeProposal`, `ListPullRequestReviews`, `ListPullRequestCommits`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — pkg/behaviourtest/drivers/scm/driver.go:21

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
M1 · Documentation (README)4.7 / 10Adequate✓ Tool-verified

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

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

  • The root README is 84 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers. — README.md:1

What to do

  • Expand the README with getting-started, architecture overview and a project map.
  • 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.
M2 · Architecture documentation10.0 / 10Exemplary✓ Tool-verified

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

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

  • `docs/guides/user/bring-your-own-agent.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `mint-wasm`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/guides/user/bring-your-own-agent.md:153

What to do

  • Update docs/guides/user/bring-your-own-agent.md so it draws the parts the code has today: add mint-wasm.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P11 · BDD / executable specs10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether behaviour is captured as executable Gherkin specifications (a plus for shared understanding) — only assessed when a BDD framework is present.

Method: Filesystem scan: BDD framework presence (SpecFlow, Gherkin files) when a project references a BDD tool. Exhaustive, deterministic.

P2 · Observability9.0 / 10Exemplary✓ Tool-verified

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

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

  • Only 4/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `cmd/mint-wasm`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling10.0 / 10Exemplary○ Nothing flagged

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.

P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X19 · Unrestored process-global state5.5 / 10Adequate✓ Tool-verified

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.

  • this function literal changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `v` environment variable (set at line 7767, cleared at line 7769) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic. — internal/cli/run.go:7764

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment passed to the operation that needs it (the `cwd=` and `env=` arguments of `subprocess.run`/`Popen`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, `contextlib.chdir`, `contextlib.redirect_stdout` or a `try`/`finally` is the least that makes the restore unconditional. In Go the same holds for `os.Chdir` and `os.Setenv`: give the child `exec.Cmd.Dir`/`Env`, or `defer` the restore.
X2 · Cancellation propagation9.8 / 10Exemplary✓ Tool-verified

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

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

  • Only 47/49 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.
  • `send` calls `http.NewRequestWithContext(…)` 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, …)`. — internal/mintcore/tracing.go:772
  • `handleFetch` calls `http.NewRequestWithContext(…)` 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/mint-wasm/main.go:151

What to do

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

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

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

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. Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.

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.

X28 · Index access outside its own emptiness guard7.6 / 10Strong✓ Tool-verified

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.

  • `m` holds what `FindStringSubmatch` returns, and `m[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(m)` (or nil) first, as the other call site does. — internal/repos/gitlab_webhook_trigger_account.go:239
  • `parts` holds what `SplitN` returns, and `parts[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(parts)` (or nil) first, as the other call site does. — REDACTED:1137
  • `urlSep.FindStringIndex(run)[1]` takes element 1 of what `FindStringIndex` returns without checking its length, and this file tests that same result elsewhere before indexing it — the result can be nil or shorter. Here a short result panics with `index out of range`. Assign it and test `len` (or nil) first, as the other call site does. — internal/cli/content_collector.go:866

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
X3 · Exception handling6.8 / 10Strong✓ Tool-verified

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

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

  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×27) — pkg/behaviourtest/steps/cleanup.go:64, pkg/behaviourtest/steps/cleanup.go:72, pkg/behaviourtest/steps/debuglogs.go:940, …
  • `if overlayErr != 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/behaviourtest/steps/cleanup.go:81
  • `created, _ := time.Parse(time.RFC3339, issue.CreatedAt)` writes the call's error to `_` and then uses `created` as if the call succeeded. When `time.Parse` fails, `created` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `created` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/behaviourtest/steps/debuglogs.go:787
  • `if err := json.Unmarshal(d.EventPayload, &payload); 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/behaviourtest/steps/jirapoll.go:474
  • `if relErr != 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/behaviourtest/steps/mint_status.go:647
  • `retry, _ := checkHarnessRunLogs(run, agent, needle, logs, fetchErr)` writes the call's error to `_` and then uses `retry` as if the call succeeded. When `checkHarnessRunLogs` fails, `retry` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `retry` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/behaviourtest/steps/runner_secrets.go:152
  • `if err := json.Unmarshal(scanner.Bytes(), &header); 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/behaviourtest/steps/runtime.go:644
  • `if parseErr != 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. (×2) — pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:265, pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:340
  • `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here. (×4) — pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:478, pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:690, pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1290, …
  • `data, _ := json.Marshal(payload)` writes the call's error to `_` and then uses `data` as if the call succeeded. When `json.Marshal` fails, `data` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `data` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:77

What to do

  • Swallowed exception (caught, then discarded)
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.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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

LensScoreRatingImpact
Code Health71.3Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture93.3ExemplaryStrongest area.
Maturity79.7StrongSolid.
Readiness86.5Adequate — gated by D11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61.2Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility63.1AdequateAcceptable, with room to improve.
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.

  • X10 Duplicated predicate — 40 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 — 18 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 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 — 49 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.

  • 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; this repository's Python 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): package.json has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. The cause is in the repository, not in our sandbox: package.json has no "dev" script, so `npm run dev` could not start the app. 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.
  • 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.
  • D19 Documentation Quality — D19 reads .NET projects and npm packages as units; 6 folder(s) declared by REDACTED, REDACTED were not judged for an overview, an example or the map.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .go, .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — 6 binding ADR(s) rule out an element in code we do not index (.go, .py); their rules were neither confirmed nor broken.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — applicable but not scored (4 signals for this style, 2 needed — the count is met but a required primary signal is absent): 4 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 3 strongly-typed id(s); 10 value object(s); 13 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 13 domain event(s); 9 event-sourced shape(s) (event folds / event-recording aggregates)
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 3 aggregate(s) with Apply/When folds; 6 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, Scala, Rust and Java, 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a `func BenchmarkXxx(b *testing.B)` in any `_test.go` file, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 4% of this repository's production lines — go (207,877 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not 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
  • X17 Uncapped recursion over a caller-supplied document — X17 reached only 4% of this repository's production lines — go (207,877 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — X25 reached only 4% of this repository's production lines — go (207,877 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Go was read, and it logs through none: the standard library's `log` takes one finished line, or it makes no log call outside its tests at all, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through log/slog, zap, logrus, zerolog, hclog, go-kit's log or logr would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 34 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Flaky test · ×4
  • Flaky test: .::github.com/fullsend-ai/fullsend/internal/cli.TestLoadAppSetPEMs_BadDir — Passed 1×, failed 2× across repeated runs.
  • Flaky test: .::github.com/fullsend-ai/fullsend/internal/cli.TestMintDeployCmd_CloudflareDryRunWithBadPemDir — Passed 1×, failed 2× across repeated runs.
  • Flaky test: .::github.com/fullsend-ai/fullsend/internal/cli.TestMintDeployCmd_DryRunWithBadPemDir — Passed 1×, failed 2× across repeated runs.
  • Flaky test: .::github.com/fullsend-ai/fullsend/internal/dispatch/cf.TestFileExistsAndNonEmpty_NonExistent — Passed 1×, failed 2× across repeated runs.
D28 · Secrets (history) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · High secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Critical IaC · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <figure> · ×1
  • Click handler on a non-interactive <figure> docs/.vitepress/theme/components/Mermaid.vue:80 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 2296 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×154
  • Hotspot: internal/cli/run.go internal/cli/run.go:493 — internal/cli/run.go changed 295 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 469 in cli.runAgent at line 493. 205 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/run.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/repos.go internal/cli/repos.go:604 — internal/cli/repos.go changed 93 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 154 in cli.runReposInstall at line 604. 41 of those changes were fix/bug commits, and the other 52 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/repos.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: internal/repos/converge.go internal/repos/converge.go:770 — internal/repos/converge.go changed 81 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 122 in repos.Converge at line 770. 45 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/converge.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: internal/cli/lock.go internal/cli/lock.go:944 — internal/cli/lock.go changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in cli.resolveFromLock at line 944. 32 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/lock.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: REDACTED REDACTED:1762 — REDACTED changed 116 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in LiveClient.commitFilesTo at line 1762. 70 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/sandbox/sandbox.go internal/sandbox/sandbox.go:161 — internal/sandbox/sandbox.go changed 73 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in sandbox.sanitizeDownload at line 161. 42 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/sandbox/sandbox.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: internal/cli/github.go internal/cli/github.go:186 — internal/cli/github.go changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in cli.runGitHubSetupPerRepo at line 186. 20 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/github.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: internal/cli/admin.go internal/cli/admin.go:339 — internal/cli/admin.go changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in cli.runPerRepoInstall at line 339. 8 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/admin.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: internal/runtime/pi_run.go internal/runtime/pi_run.go:1181 — internal/runtime/pi_run.go changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in PiRuntime.Run at line 1181. 40 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/pi_run.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/harness/compose.go internal/harness/compose.go:228 — internal/harness/compose.go changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in harness.LoadWithBase at line 228. 40 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/harness/compose.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: internal/poll/poll.go internal/poll/poll.go:74 — internal/poll/poll.go changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in Poller.Run at line 74. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/poll/poll.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: internal/repos/install.go internal/repos/install.go:260 — internal/repos/install.go changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in repos.Install at line 260. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/install.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: internal/config/config.go internal/config/config.go:789 — internal/config/config.go changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in config.validateAgentEntries at line 789. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/config/config.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: internal/repos/gitlab_roles_rotate.go internal/repos/gitlab_roles_rotate.go:354 — internal/repos/gitlab_roles_rotate.go changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in repos.rotateOneRole at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/gitlab_roles_rotate.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: internal/runtime/codex_run.go internal/runtime/codex_run.go:519 — internal/runtime/codex_run.go changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in CodexRuntime.Run at line 519. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/codex_run.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/repos/gitlab_webhook.go internal/repos/gitlab_webhook.go:1956 — internal/repos/gitlab_webhook.go changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in repos.ensureGitLabWebhookFastPath at line 1956. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/gitlab_webhook.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: internal/repos/status.go internal/repos/status.go:298 — internal/repos/status.go changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in repos.checkRepoStatus at line 298. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/status.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: REDACTED REDACTED:762 — REDACTED changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in Manifest.validate at line 762. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/repos/uninstall.go internal/repos/uninstall.go:318 — internal/repos/uninstall.go changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in repos.uninstallRepoResources at line 318. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/uninstall.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: internal/runtime/pi_bootstrap.go internal/runtime/pi_bootstrap.go:204 — internal/runtime/pi_bootstrap.go changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in PiRuntime.Bootstrap at line 204. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/pi_bootstrap.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: REDACTED REDACTED:533 — REDACTED changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Harness.Validate at line 533. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/runtime/codex_bootstrap.go internal/runtime/codex_bootstrap.go:131 — internal/runtime/codex_bootstrap.go changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in CodexRuntime.Bootstrap at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/codex_bootstrap.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/behaviourtest/steps/cleanup.go pkg/behaviourtest/steps/cleanup.go:116 — pkg/behaviourtest/steps/cleanup.go changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in steps.CleanupScenario at line 116. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- pkg/behaviourtest/steps/cleanup.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: internal/runtime/pi_progress.go internal/runtime/pi_progress.go:356 — internal/runtime/pi_progress.go changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in runtime.parsePiStream at line 356. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/pi_progress.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: internal/repos/probe.go internal/repos/probe.go:87 — internal/repos/probe.go changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in repos.ProbeComponentsForAuth at line 87. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/probe.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.
  • + 129 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×56
  • Repeated repair: REDACTED REDACTED:1004 — REDACTED changed 57 times in last 90 days and 30 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is FakeClient.ForceCommitFileToBranch at line 1004), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#9292)!: render managed config in the pinned fullsend_ref schema”; “fix(review): address deduplication review findings”; “fix(review): include file modes in deduplication”; “fix(#8841): fall back to fork default branch for unsynced GitLab forks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/runtime/env_data.go internal/runtime/env_data.go:226 — internal/runtime/env_data.go changed 15 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is runtime.envDataLoadWith at line 226), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8626)!: pin the CLI binaries and their node on the trusted PATH”; “fix(hooks): keep relative entries off the trusted PATH as root”; “fix(#8574): run the probes' find and gh from the trusted PATH”; “fix(#8574)!: read .env as data in the OpenCode launch and runner probes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/env_data.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.
  • Repeated repair: internal/runtime/event.go internal/runtime/event.go:26 — internal/runtime/event.go changed 21 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is InitEvent.agentEvent at line 26), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#7414): answer a pi call whose end line exceeds the buffer”; “fix(#7414): mark a pi result with no start as unmatched, correct the docs”; “fix(#8908): sanitize Unicode progress in a dedicated reconciler”; “fix(#8908): retain workflow controls and sparse task metadata”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/event.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.
  • Repeated repair: internal/agentnew/render.go internal/agentnew/render.go:46 — internal/agentnew/render.go changed 15 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is agentnew.Render at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#7360)!: inherit readonly_repo through base: composition”; “fix(#8648): use work item URL in generated agents”; “fix(agentnew): scaffold OPENCODE_CONFIG_CONTENT env.sandbox for opencode”; “fix(#7980)!: refuse Vertex sub-agents without a usable credential file”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/agentnew/render.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.
  • Repeated repair: internal/cli/inference_openai.go internal/cli/inference_openai.go:117 — internal/cli/inference_openai.go changed 14 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is cli.newInferenceOpenAIRequestCmd at line 117), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8280): guard gateway children and env clear, move OIDC fetch”; “fix(#7295): forward FULLSEND_OPENAI_API_KEY to this repo's installed shims, delete it on uninstall”; “fix(#7295): correct CI static-key detection and validation scope for FULLSEND_OPENAI_API_KEY”; “fix(#6782): report an audience disagreement even when --audience overrides it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/inference_openai.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.
  • Repeated repair: internal/tracker/jira_client.go internal/tracker/jira_client.go:282 — internal/tracker/jira_client.go changed 18 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is JiraClient.FindStatusComment at line 282), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(jirapoll): fail all-invalid cycles; treat nil labels as unlabeled”; “fix(#9023): skip redundant Jira sticky-marker property writes”; “fix(#8539): neutralize fullsend markers on the Jira sticky path”; “fix(#7083): address issues create review findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/tracker/jira_client.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.
  • Repeated repair: internal/runtime/opencode.go internal/runtime/opencode.go:20 — internal/runtime/opencode.go changed 15 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is OpenCodeRuntime.Name at line 20), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8574)!: read .env as data in the OpenCode launch and runner probes”; “fix(runtime): pin OpenCode 1.19.1 and re-verify the agent each iteration”; “fix(runtime): address PR review findings in OpenCode runtime”; “fix(runtime): harden OpenCode sandbox config, env denylist, and skill loading”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/opencode.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.
  • Repeated repair: internal/cli/tool_spans.go internal/cli/tool_spans.go:108 — internal/cli/tool_spans.go changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is toolSpanTracker.Handle at line 108), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#7414): answer a pi call whose end line exceeds the buffer”; “fix(#7414): mark a pi result with no start as unmatched, correct the docs”; “fix(telemetry): one literal pass for Level 3 strings and execute_tool names and ids”; “fix(telemetry): repeat the runner env literal pass after the pipeline”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/tool_spans.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.
  • Repeated repair: internal/repos/remote_scaffold.go internal/repos/remote_scaffold.go:111 — internal/repos/remote_scaffold.go changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is repos.fetchRemoteGitLabScaffold at line 111), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8865)!: pin GitLab runner image to fullsend_ref instead of :dev”; “fix: address review feedback on PR #8021”; “fix(#7769): harden GitLab poll/agent in-job identity gates”; “fix(#7790): check out GitLab MR source before fix sandbox”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/remote_scaffold.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.
  • Repeated repair: pkg/behaviourtest/steps/owners.go pkg/behaviourtest/steps/owners.go:143 — pkg/behaviourtest/steps/owners.go changed 16 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is steps.whenIssueOpenedForOwnersAuth at line 143), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#9469): retry any driver's lost dispatch and refund cut grace”; “fix(#9469): bound total grace wait time and retry only lost dispatches”; “fix(#9469): share grace window and mark partial waits inconclusive”; “fix(#8961): keep agent artifact downloads off the ci.Driver interface”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- pkg/behaviourtest/steps/owners.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.
  • Repeated repair: internal/dispatch/router.go internal/dispatch/router.go:124 — internal/dispatch/router.go changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is HarnessRouter.routeSlashCommand at line 124), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8912)!: gate close-event retro by write access”; “fix(#8912): enforce write floor in CEL close routing”; “fix: address review feedback on PR #8956 (round 3)”; “fix: address review feedback on PR #8956”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/dispatch/router.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.
  • Repeated repair: internal/runtime/codex.go internal/runtime/codex.go:35 — internal/runtime/codex.go changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is CodexRuntime.ProviderFor at line 35), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8295): report gateway models as served by the gateway”; “fix(#8311): address review of credential seed ordering”; “fix(#8311): keep a stale credential seed from replacing a newer one”; “fix(codex): load the repo's AGENTS.md through CODEX_HOME”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/codex.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.
  • Repeated repair: internal/config/inference_gateway.go internal/config/inference_gateway.go:531 — internal/config/inference_gateway.go changed 12 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is config.ValidateGatewayCompat at line 531), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8280): address review feedback on PR #8300”; “fix(#8280): guard gateway children and env clear, move OIDC fetch”; “fix(#8280): sanitise printed model ids and reject encoded gateway paths”; “fix(#8280): harden the gateway status probe, profile binding and BT cleanup”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/config/inference_gateway.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.
  • Repeated repair: internal/runtime/claude_integrity.go internal/runtime/claude_integrity.go:77 — internal/runtime/claude_integrity.go changed 10 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is runtime.claudeHookDigestsFor at line 77), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8750): pin nonessential traffic off without sandbox hooks”; “fix(runtime): pin the cleared launch variables in the settings env block”; “fix(#8641): pin runner-owned settings in the claude --settings document”; “fix(#8635): take hook settings from the runner after .env on all runtimes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/claude_integrity.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.
  • Repeated repair: internal/telemetry/telemetry.go internal/telemetry/telemetry.go:71 — internal/telemetry/telemetry.go changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is telemetry.sanitizeError at line 71), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: address review feedback on PR #8273”; “fix(#8255): stop echoing OTLP endpoint values in validation errors”; “fix(telemetry): validate OTLP headers and redact credentials in logs”; “fix(cli): scan listed numbers, reject trailing input, keep the record private”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/telemetry/telemetry.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.
  • Repeated repair: internal/runtime/opencode_integrity.go internal/runtime/opencode_integrity.go:108 — internal/runtime/opencode_integrity.go changed 8 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is runtime.validateOpenCodePermissionPolicy at line 108), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8626)!: pin the CLI binaries and their node on the trusted PATH”; “fix(#8574)!: read .env as data in the OpenCode launch and runner probes”; “fix(runtime): reject duplicate OpenCode permission keys, clear plugin dirs”; “fix(runtime): close OpenCode review findings on the takeover PR”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/opencode_integrity.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.
  • Repeated repair: internal/harnessdispatch/core.go internal/harnessdispatch/core.go:32 — internal/harnessdispatch/core.go changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is harnessdispatch.Dispatch at line 32), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8401): address review feedback on PR #8892”; “fix(#8724): filter harnesses before CEL and align authorization docs”; “fix(#8725): skip built-in agents in GitHub CEL dispatch”; “fix(#6042): resolve OWNERS alias keys before logins”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/harnessdispatch/core.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.
  • Repeated repair: internal/runtime/bootstrap.go internal/runtime/bootstrap.go:91 — internal/runtime/bootstrap.go changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is runtime.pluginsOfKind at line 91), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex)!: bind the run's effort for children and count spawns on disk”; “fix(#7981): resolve openai children exactly as Bootstrap does”; “fix(#7981): create openai provider for pi sub-agents under any parent”; “fix(#7741): address review on the codex AGENTS.md bridge”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/bootstrap.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.
  • Repeated repair: internal/repos/ref_ops.go internal/repos/ref_ops.go:174 — internal/repos/ref_ops.go changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is repos.compareSemver at line 174), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#7902): ignore spacing-only ref changes in converge”; “fix(#7902): two spaces before inline version comments”; “fix(#7648): gate schedule reactivation and preserve SHA pinning on review feedback”; “fix(#7648): converge inactive GitLab schedules and stale dispatch”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/repos/ref_ops.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.
  • Repeated repair: internal/cli/run_gateway.go internal/cli/run_gateway.go:142 — internal/cli/run_gateway.go changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is cli.validateClaudeGatewayModels at line 142), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8294): Bearer in both modes, pin the route in --settings, document the helper limit”; “fix(#8280): fail the OpenAI route closed when a new generation never arrives”; “fix(#8280): fail the gateway route closed when a new generation never arrives”; “fix(#8280): address review feedback on PR #8300”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/run_gateway.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.
  • Repeated repair: internal/scaffold/vendormanifest.go internal/scaffold/vendormanifest.go:78 — internal/scaffold/vendormanifest.go changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is scaffold.isSafeVendoredRepoPath at line 78), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): cover routed review deduplication”; “fix(#9203): vendor retry-with-backoff.sh with the installers that source it”; “fix(dispatch): ship count-fix-commits.jq to vendored installs”; “fix(#8353): paginate review-body pre-fetch and wire it into the fix job”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/scaffold/vendormanifest.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.
  • Repeated repair: internal/cli/bootstrap_input.go internal/cli/bootstrap_input.go:60 — internal/cli/bootstrap_input.go changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is cli.pluginInputs at line 60), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#6158): stage URL skills before routing and mirror persona registration”; “fix(codex)!: bind the run's effort for children and count spawns on disk”; “fix(#7981): create openai provider for pi sub-agents under any parent”; “fix(codex): pin the target repository's project trust to untrusted”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/cli/bootstrap_input.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.
  • Repeated repair: internal/runtime/codex_redact.go internal/runtime/codex_redact.go:226 — internal/runtime/codex_redact.go changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is runtime.codexIsRolloutFile at line 226), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#7721): allow every rollout line type codex writes”; “fix(#7721): keep codex 0.152.1 rollouts with world_state”; “fix(runtime): pin PATH across .env and re-verify codex hook scripts per invocation”; “fix(runtime): stop the codex hook children writing bytecode into the guarded dir”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/codex_redact.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.
  • Repeated repair: internal/runtime/pi_gateway_run.go internal/runtime/pi_gateway_run.go:99 — internal/runtime/pi_gateway_run.go changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is runtime.ValidatePiGatewayPluginEnv at line 99), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#8311): address review of credential seed ordering”; “fix(#8311): keep a stale credential seed from replacing a newer one”; “fix(#8280): give gateway sub-agents a private copy of the verified config”; “fix(#8280): give each gateway token seed its own temp file”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/runtime/pi_gateway_run.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/harnessdispatch/enumerate.go internal/harnessdispatch/enumerate.go:41 — internal/harnessdispatch/enumerate.go changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is harnessdispatch.ListTriggeredHarnesses at line 41), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#9037): pass configured GitHub host to remaining compose callers”; “fix(forge): resolve the config allowlist the same way in every loader”; “fix(#8726): fail the review route on invalid config, keep harness dispatch triggers”; “fix(#7348): fail dispatch when no harness can be loaded”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:34:51 +00:00' --until='2026-11-16 12:34:51 +00:00' --full-history --no-merges -- internal/harnessdispatch/enumerate.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.
  • + 31 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×53
  • FileTooLong: cli/run.go internal/cli/run.go — FileTooLong — 4376 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3876 over it, 8.75× 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 — 3374 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: LiveClient (175 blocks, 46-5802). The bar is 500 significant lines; this is 2874 over it, 6.75× 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: repos/converge.go internal/repos/converge.go — FileTooLong — 2150 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1650 over it, 4.30× 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: scripts/nextwork.py skills/nextwork/scripts/nextwork.py — FileTooLong — 2129 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1629 over it, 4.26× 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 — 2121 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FakeClient (143 blocks, 214-3375). The bar is 500 significant lines; this is 1621 over it, 4.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: harness/compose.go internal/harness/compose.go — FileTooLong — 1546 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1046 over it, 3.09× 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: repos/gitlab_webhook.go internal/repos/gitlab_webhook.go — FileTooLong — 1399 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 899 over it, 2.80× 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: cli/mint.go internal/cli/mint.go — FileTooLong — 1344 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 844 over it, 2.69× 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: gcf/gcp.go internal/dispatch/gcf/gcp.go — FileTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: LiveGCFClient (43 blocks, 226-2187). The bar is 500 significant lines; this is 772 over it, 2.54× 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: gcf/provisioner.go internal/dispatch/gcf/provisioner.go — FileTooLong — 1232 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: Provisioner (45 blocks, 219-2264). The bar is 500 significant lines; this is 732 over it, 2.46× 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: repos/gitlab_trigger_account.go internal/repos/gitlab_trigger_account.go — FileTooLong — 1170 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: gitLabTriggerAccountOp (47 blocks, 372-2104). The bar is 500 significant lines; this is 670 over it, 2.34× 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: repos/gitlab_roles_rotate.go internal/repos/gitlab_roles_rotate.go — FileTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 656 over it, 2.31× 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: gitlab/ci.go internal/forge/gitlab/ci.go — FileTooLong — 1137 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: LiveClient (66 blocks, 24-2013). The bar is 500 significant lines; this is 637 over it, 2.27× 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: cli/repos.go internal/cli/repos.go — FileTooLong — 1026 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 526 over it, 2.05× 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: poll/state.go internal/poll/state.go — FileTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 504 over it, 2.01× 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: githubactions/githubactions.go pkg/behaviourtest/drivers/ci/githubactions/githubactions.go — FileTooLong — 1001 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: Driver (36 blocks, 73-2078). The bar is 500 significant lines; this is 501 over it, 2.00× 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 — 973 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 473 over it, 1.95× 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: repos/gitlabci.go internal/repos/gitlabci.go — FileTooLong — 964 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 464 over it, 1.93× 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: cli/admin.go internal/cli/admin.go — FileTooLong — 912 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 412 over it, 1.82× 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: cli/lock.go internal/cli/lock.go — FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 408 over it, 1.82× 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: repos/manifest_set.go internal/repos/manifest_set.go — FileTooLong — 872 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 372 over it, 1.74× 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 — 852 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: LiveClient (44 blocks, 68-1557). The bar is 500 significant lines; this is 352 over it, 1.70× 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: jira/adf.go internal/forge/jira/adf.go — FileTooLong — 766 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 266 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: gitlab/mr.go internal/forge/gitlab/mr.go — FileTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: LiveClient (24 blocks, 23-1259). The bar is 500 significant lines; this is 248 over it, 1.50× 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: analyze-transcript/analyze-transcript.py skills/analyze-transcript/analyze-transcript.py — FileTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 242 over it, 1.48× 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.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×51
  • Duplicated block (7 lines × 2) internal/cli/admin.go:764 — internal/cli/admin.go:764-770 | internal/cli/admin.go:1001-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/cli/fetchreviewthreads.go:26 — internal/cli/fetchreviewthreads.go:26-32 | REDACTED:117-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/cli/run.go:6176 — internal/cli/run.go:6176-6182 | internal/runtime/codex_run.go:69-75 — 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 `internal/cli/run.go:6176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/dispatch/gcf/gcp.go:441 — internal/dispatch/gcf/gcp.go:441-447 | internal/dispatch/gcf/gcp.go:1216-1222 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/dispatch/gcf/gcp.go:1822 — internal/dispatch/gcf/gcp.go:1822-1828 | internal/dispatch/gcf/gcp.go:2057-2063 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:1822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/dispatch/gcf/provisioner.go:1284 — internal/dispatch/gcf/provisioner.go:1284-1290 | internal/dispatch/gcf/provisioner.go:1361-1367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) REDACTED:1292 — REDACTED:1292-1298 | REDACTED:1498-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/harness/compose.go:1826 — internal/harness/compose.go:1826-1832 | internal/harness/compose.go:1890-1896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/harness/compose.go:2301 — internal/harness/compose.go:2301-2307 | internal/harness/compose.go:2510-2516 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:2301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/mintcore/github.go:741 — internal/mintcore/github.go:741-747 | internal/mintcore/github.go:773-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/mintcore/github.go:741` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/mintcore/github.go:819 — internal/mintcore/github.go:819-825 | internal/mintcore/github.go:1088-1094 — both copies are in the same file, so extract the 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 `internal/mintcore/github.go:819` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/mintcore/jwks_verifier.go:91 — internal/mintcore/jwks_verifier.go:91-97 | internal/mintcore/sts_verifier.go:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/mintcore/jwks_verifier.go:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/repos/gitlab_roles_rotate.go:1685 — internal/repos/gitlab_roles_rotate.go:1685-1691 | internal/repos/gitlab_webhook_poller.go:730-736 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/runtime/codex_subagents.go:96 — internal/runtime/codex_subagents.go:96-102 | internal/runtime/pi_subagents.go:166-172 — 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 `internal/runtime/codex_subagents.go:96` 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/behaviourtest/steps/playback.go:494 — pkg/behaviourtest/steps/playback.go:494-500 | pkg/behaviourtest/steps/playback.go:552-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/cli/repos_gitlab_service_accounts.go:277 — internal/cli/repos_gitlab_service_accounts.go:277-283 | internal/gitlablifecycle/trigger_account.go:44-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) REDACTED:3761 — REDACTED:3761-3767 | pkg/behaviourtest/suite/init.go:291-297 — 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:3761` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Check import visibility before settling on that home: `REDACTED` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (7 lines × 2) internal/jirapoll/convert.go:321 — internal/jirapoll/convert.go:321-327 | internal/poll/convert.go:430-436 — 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) internal/jirapoll/lock.go:80 — internal/jirapoll/lock.go:80-86 | internal/poll/poll.go:859-865 — 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) internal/security/hooks.go:301 — internal/security/hooks.go:301-307 | internal/security/sandbox_hooks.go:44-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) pkg/behaviourtest/drivers/scm/github/github.go:102 — pkg/behaviourtest/drivers/scm/github/github.go:102-108 | pkg/behaviourtest/drivers/scm/gitlab/gitlab.go:93-99 — `pkg/behaviourtest/drivers/scm/github/github.go` and `pkg/behaviourtest/drivers/scm/gitlab/gitlab.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) pkg/behaviourtest/drivers/scm/github/github.go:110 — pkg/behaviourtest/drivers/scm/github/github.go:110-116 | pkg/behaviourtest/drivers/scm/gitlab/gitlab.go:101-107 — `pkg/behaviourtest/drivers/scm/github/github.go` and `pkg/behaviourtest/drivers/scm/gitlab/gitlab.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) pkg/behaviourtest/drivers/scm/github/github.go:118 — pkg/behaviourtest/drivers/scm/github/github.go:118-124 | pkg/behaviourtest/drivers/scm/gitlab/gitlab.go:109-115 — `pkg/behaviourtest/drivers/scm/github/github.go` and `pkg/behaviourtest/drivers/scm/gitlab/gitlab.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) internal/config/managed_safety.go:38 — internal/config/managed_safety.go:38-44 | internal/runtime/pi_personas.go:683-689 — 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) pkg/behaviourtest/steps/bot_role_probe.go:397 — pkg/behaviourtest/steps/bot_role_probe.go:397-403 | pkg/behaviourtest/steps/mint_probe.go:644-650 — 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.
  • + 26 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×38
  • FunctionTooLong: cli.runAgent internal/cli/run.go:493 — FunctionTooLong — runAgent runs 1496 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1396 over it, 14.96× 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: cli.runReposInstall internal/cli/repos.go:604 — FunctionTooLong — runReposInstall runs 461 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 361 over it, 4.61× 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: repos.Converge internal/repos/converge.go:770 — FunctionTooLong — Converge runs 406 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.runPerRepoInstall internal/cli/admin.go:339 — FunctionTooLong — runPerRepoInstall runs 393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× 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: repos.rotateOneRole internal/repos/gitlab_roles_rotate.go:354 — FunctionTooLong — rotateOneRole runs 345 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 245 over it, 3.45× 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: repos.convergeRepo internal/repos/converge.go:1496 — FunctionTooLong — convergeRepo runs 281 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.resolveFromLock internal/cli/lock.go:944 — FunctionTooLong — resolveFromLock runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: runtime.parsePiStream internal/runtime/pi_progress.go:356 — FunctionTooLong — parsePiStream runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: repos.ensureGitLabWebhookFastPath internal/repos/gitlab_webhook.go:1956 — FunctionTooLong — ensureGitLabWebhookFastPath runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: runtime.parseClaudeStream internal/runtime/claude_progress.go:244 — FunctionTooLong — parseClaudeStream runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× 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: cli.runMintDeployCloudflare internal/cli/mint.go:910 — FunctionTooLong — runMintDeployCloudflare runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.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.
  • FunctionTooLong: cli.runGitHubSetupPerRepo internal/cli/github.go:186 — FunctionTooLong — runGitHubSetupPerRepo runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.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.
  • FunctionTooLong: cli.lockOneAgent internal/cli/lock.go:208 — FunctionTooLong — lockOneAgent runs 191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× 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: repos.convergeRefFiles internal/repos/converge.go:2979 — FunctionTooLong — convergeRefFiles runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: repos.uninstallRepoResources internal/repos/uninstall.go:318 — FunctionTooLong — uninstallRepoResources runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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: cli.runMintStatus internal/cli/mint.go:1753 — FunctionTooLong — runMintStatus runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: steps.CleanupScenario pkg/behaviourtest/steps/cleanup.go:116 — FunctionTooLong — CleanupScenario 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.
  • FunctionTooLong: repos.ProbeComponentsForAuth internal/repos/probe.go:87 — FunctionTooLong — ProbeComponentsForAuth runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: resolve.ResolveHarness internal/resolve/resolve.go:285 — FunctionTooLong — ResolveHarness runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: repos.provisionOwnRoles internal/repos/gitlab_roles.go:449 — FunctionTooLong — provisionOwnRoles runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× 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: runtime.decodeClaudeStatusProgress internal/runtime/claude_status_progress.go:13 — FunctionTooLong — decodeClaudeStatusProgress runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× 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: cli.runLint internal/cli/lint.go:197 — FunctionTooLong — runLint runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.runReposUninstall internal/cli/repos.go:1534 — FunctionTooLong — runReposUninstall runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× 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: harness.resolveBaseScripts internal/harness/compose.go:1098 — FunctionTooLong — resolveBaseScripts runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.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: repos.checkRepoStatus internal/repos/status.go:298 — FunctionTooLong — checkRepoStatus runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×37
  • Duplicated block (8 lines × 2) internal/cli/postcomment.go:60 — internal/cli/postcomment.go:60-67 | REDACTED:120-127 — 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 `internal/cli/postcomment.go:60` 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) REDACTED:522 — REDACTED:522-529 | REDACTED:548-555 — both copies are in the same file, so extract the 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:522` 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) REDACTED:699 — REDACTED:699-706 | REDACTED:727-734 — both copies are in the same file, so extract the 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) internal/harness/compose.go:1811 — internal/harness/compose.go:1811-1818 | internal/harness/compose.go:1877-1884 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1811` 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) internal/harness/compose.go:2315 — internal/harness/compose.go:2315-2322 | internal/harness/compose.go:2520-2527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/poll/events.go:499 — internal/poll/events.go:499-506 | internal/poll/webhook.go:649-656 — 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) internal/runtime/pi_personas.go:415 — internal/runtime/pi_personas.go:415-422 | internal/runtime/pi_personas.go:424-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/pi_personas.go:415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/behaviourtest/run.go:75 — pkg/behaviourtest/run.go:75-82 | pkg/behaviourtest/run_playback.go:91-98 — 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/behaviourtest/run.go:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/behaviourtest/run_playback.go:86` calls `NewPlaybackDriver` and `pkg/behaviourtest/run.go:70` 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 (8 lines × 2) pkg/behaviourtest/steps/base_dispatch.go:57 — pkg/behaviourtest/steps/base_dispatch.go:57-64 | pkg/behaviourtest/steps/base_dispatch.go:207-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/base_dispatch.go:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/behaviourtest/steps/runtime.go:468 — pkg/behaviourtest/steps/runtime.go:468-475 | pkg/behaviourtest/steps/runtime.go:515-522 — both copies are in the same file, so extract the 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/behaviourtest/steps/runtime.go:468` 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/behaviourtest/drivers/ci/githubactions/githubactions.go:1670 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1670-1677 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:691-698 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1670` 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) internal/repos/gitlab_trigger_consumer.go:172 — internal/repos/gitlab_trigger_consumer.go:172-179 | internal/repos/gitlab_trigger_dispatch_gate.go:772-779 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/cli/provider_profile_report.go:244 — internal/cli/provider_profile_report.go:244-251 | pkg/behaviourtest/report.go:276-283 — 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. Check import visibility before settling on that home: `internal/cli/provider_profile_report.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (8 lines × 2) internal/dispatch/cf/provisioner.go:929 — internal/dispatch/cf/provisioner.go:929-936 | internal/statuscomment/statuscomment.go:606-613 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/jirapoll/discover.go:25 — internal/jirapoll/discover.go:25-32 | internal/tracker/jira_client.go:29-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/repos/gitlabci.go:2006 — internal/repos/gitlabci.go:2006-2013 | internal/repos/manifest_set.go:979-986 — 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/behaviourtest/drivers/scm/github/github.go:49 — pkg/behaviourtest/drivers/scm/github/github.go:49-56 | pkg/behaviourtest/drivers/scm/gitlab/gitlab.go:40-47 — `pkg/behaviourtest/drivers/scm/github/github.go` and `pkg/behaviourtest/drivers/scm/gitlab/gitlab.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 2) pkg/behaviourtest/steps/base_dispatch.go:47 — pkg/behaviourtest/steps/base_dispatch.go:47-55 | pkg/behaviourtest/steps/base_dispatch.go:198-205 — both copies are in the same file, so extract the 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/behaviourtest/steps/base_dispatch.go:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/forge/gitlab/ci.go:1872 — internal/forge/gitlab/ci.go:1872-1879 | internal/forge/gitlab/deploy_keys.go:221-228 — 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 `internal/forge/gitlab/ci.go:1872` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/repos/gitlab_trigger_account.go:1801 — internal/repos/gitlab_trigger_account.go:1801-1808 | internal/repos/gitlab_trigger_schedules.go:693-700 — 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 `internal/repos/gitlab_trigger_account.go:1801` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/behaviourtest/steps/bot_role_probe.go:286 — pkg/behaviourtest/steps/bot_role_probe.go:286-293 | pkg/behaviourtest/steps/mint_probe.go:420-427 — 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/behaviourtest/steps/bot_role_probe.go:286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:3426 — REDACTED:3426-3433 | REDACTED:3481-3488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) internal/dispatch/gcf/gcp.go:1394 — internal/dispatch/gcf/gcp.go:1394-1401 | internal/dispatch/gcf/gcp.go:1449-1456 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:1394` 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) internal/runtime/dummy.go:366 — internal/runtime/dummy.go:366-373 | internal/runtime/dummy.go:478-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:455 — pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:455-462 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:668-675 — both copies are in the same file, so extract the 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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:455` 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.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×35
  • Duplicated block (9 lines × 2) internal/artifacts/measurements.go:32 — internal/artifacts/measurements.go:32-40 | internal/artifacts/telemetry.go:56-64 — 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 `internal/artifacts/measurements.go:32` 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) internal/binary/download.go:55 — internal/binary/download.go:55-63 | internal/binary/download.go:207-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/binary/download.go:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) internal/cli/foreign.go:70 — internal/cli/foreign.go:70-78 | internal/cli/foreign.go:302-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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, `internal/cli/foreign.go:300` calls `label` and `internal/cli/foreign.go:68` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) internal/cli/mint.go:1356 — internal/cli/mint.go:1356-1364 | internal/cli/mint.go:1543-1551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/cli/mint.go:1381 — internal/cli/mint.go:1381-1390 | internal/cli/mint_setup.go:443-451 — 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 `internal/cli/mint.go:1381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/cli/poll.go:197 — internal/cli/poll.go:197-205 | internal/cli/poll_jira_gitlab.go:130-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/cli/run.go:3494 — internal/cli/run.go:3494-3502 | internal/runtime/pi_bootstrap.go:988-996 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) internal/cli/run.go:8088 — internal/cli/run.go:8088-8096 | internal/cli/run.go:8401-8409 — both copies are in the same file, so extract the 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 `internal/cli/run.go:8088` 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) internal/cli/run.go:8452 — internal/cli/run.go:8452-8460 | internal/harness/registry.go:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:8452` 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) internal/dispatch/gcf/gitlab_wif.go:95 — internal/dispatch/gcf/gitlab_wif.go:95-103 | internal/mintcore/wif.go:19-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) internal/dispatch/gcf/provisioner.go:429 — internal/dispatch/gcf/provisioner.go:429-437 | internal/dispatch/gcf/provisioner.go:469-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:1122 — REDACTED:1122-1130 | internal/forge/gitlab/gitlab.go:396-404 — 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 (9 lines × 2) internal/gitlablifecycle/trigger_owner.go:295 — internal/gitlablifecycle/trigger_owner.go:295-303 | internal/gitlablifecycle/trigger_owner.go:449-457 — both copies are in the same file, so extract the 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 `internal/gitlablifecycle/trigger_owner.go:295` 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 (9 lines × 2) internal/mintcore/github.go:352 — internal/mintcore/github.go:352-360 | internal/mintcore/github.go:365-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/mintcore/github.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.
  • Duplicated block (9 lines × 2) internal/poll/events.go:138 — internal/poll/events.go:138-150 | internal/poll/events.go:211-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) internal/repos/converge.go:467 — internal/repos/converge.go:467-475 | internal/repos/converge.go:2195-2203 — both copies are in the same file, so extract the 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 `internal/repos/converge.go:467` 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) internal/repos/converge.go:3089 — internal/repos/converge.go:3089-3097 | internal/repos/converge.go:3163-3171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/repos/gitlabci.go:660 — internal/repos/gitlabci.go:660-668 | internal/repos/gitlabci.go:684-692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:1667 — REDACTED:1667-1675 | REDACTED:1704-1712 — both copies are in the same file, so extract the 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:1667` 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:96 — REDACTED:96-104 | REDACTED:129-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) pkg/behaviourtest/steps/base_dispatch.go:153 — pkg/behaviourtest/steps/base_dispatch.go:153-161 | pkg/behaviourtest/steps/base_dispatch.go:230-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/behaviourtest/steps/base_dispatch.go:152` calls `Sprintf` and `pkg/behaviourtest/steps/base_dispatch.go:228` 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 (9 lines × 2) pkg/behaviourtest/steps/jirapoll.go:501 — pkg/behaviourtest/steps/jirapoll.go:501-509 | pkg/behaviourtest/steps/mint_status.go:246-254 — 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/behaviourtest/steps/jirapoll.go:501` 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) pkg/behaviourtest/steps/reaction.go:84 — pkg/behaviourtest/steps/reaction.go:84-92 | pkg/behaviourtest/steps/reaction.go:104-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/reaction.go:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/behaviourtest/steps/reaction.go:113` calls `Errorf` and `pkg/behaviourtest/steps/reaction.go:93` 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 (9 lines × 2) internal/actorcache/actorcache.go:115 — internal/actorcache/actorcache.go:115-123 | internal/normentity/id.go:83-91 — before extracting anything, compare `internal/actorcache/actorcache.go` and `internal/normentity/id.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
  • Duplicated block (9 lines × 2) internal/cli/repos.go:1263 — internal/cli/repos.go:1263-1271 | internal/cli/repos.go:1348-1362 — both copies are in the same file, so extract the 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 `internal/cli/repos.go:1263` 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.
  • + 10 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×33
  • Swallowed exception (caught, then discarded) pkg/behaviourtest/steps/cleanup.go:64 — `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/behaviourtest/steps/cleanup.go:72 — `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/behaviourtest/steps/cleanup.go:81 — `if overlayErr != 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/behaviourtest/steps/debuglogs.go:940 — `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/behaviourtest/steps/jirapoll.go:474 — `if err := json.Unmarshal(d.EventPayload, &payload); 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/behaviourtest/steps/jirapoll_transport.go:145 — `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/behaviourtest/steps/mint_status.go:647 — `if relErr != 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/behaviourtest/steps/reaction.go:127 — `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/behaviourtest/steps/reaction.go:131 — `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/behaviourtest/steps/runtime.go:622 — `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/behaviourtest/steps/runtime.go:644 — `if err := json.Unmarshal(scanner.Bytes(), &header); 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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:165 — `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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:201 — `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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:265 — `if parseErr != 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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:498 — `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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:576 — `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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:709 — `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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:847 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:136 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:161 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:180 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:272 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:340 — `if parseErr != 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/behaviourtest/drivers/ci/githubactions/githubactions.go:1437 — `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/behaviourtest/drivers/ci/githubactions/githubactions.go:1594 — `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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×29
  • Duplicated block (10 lines × 2) internal/celtrigger/celtrigger.go:65 — internal/celtrigger/celtrigger.go:65-74 | internal/harness/trigger.go:71-80 — 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 `internal/celtrigger/celtrigger.go:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/cli/inference.go:110 — internal/cli/inference.go:110-119 | internal/cli/inference.go:348-357 — both copies are in the same file, so extract the 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 `internal/cli/inference.go:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/cli/lock.go:121 — internal/cli/lock.go:121-130 | internal/cli/lock.go:522-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/cli/lock.go:431 — internal/cli/lock.go:431-440 | internal/cli/run.go:862-871 — 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 `internal/cli/lock.go:431` 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 (10 lines × 2) internal/cli/mint.go:2180 — internal/cli/mint.go:2180-2189 | internal/cli/mint.go:2262-2271 — both copies are in the same file, so extract the 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 `internal/cli/mint.go:2180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/cli/repos_gitlab_service_accounts.go:290 — internal/cli/repos_gitlab_service_accounts.go:290-299 | internal/gitlablifecycle/trigger_account.go:33-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. 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 (10 lines × 2) internal/cli/repos_gitlab_service_accounts.go:310 — internal/cli/repos_gitlab_service_accounts.go:310-319 | internal/gitlablifecycle/trigger_account.go:77-86 — 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 (10 lines × 2) REDACTED:2869 — REDACTED:2869-2878 | REDACTED:2900-2909 — both copies are in the same file, so extract the 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:2869` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:1832 — REDACTED:1832-1841 | REDACTED:1231-1241 — 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:1832` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/forge/gitlab/ci.go:239 — internal/forge/gitlab/ci.go:239-248 | internal/forge/gitlab/ci.go:362-371 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/ci.go:239` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/forge/gitlab/ci.go:1162 — internal/forge/gitlab/ci.go:1162-1171 | internal/forge/gitlab/ci.go:1198-1207 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/ci.go:1162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/harness/compose.go:1195 — internal/harness/compose.go:1195-1204 | internal/harness/compose.go:1259-1268 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1195` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/repos/gitlab_roles.go:394 — internal/repos/gitlab_roles.go:394-403 | internal/repos/gitlab_roles_rotate.go:241-250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:921 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:921-930 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:134-143 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:921` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1282 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1282-1291 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1661-1670 — both copies are in the same file, so extract the 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/behaviourtest/drivers/ci/githubactions/githubactions.go:1282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) REDACTED:1109 — REDACTED:1109-1118 | internal/forge/gitlab/gitlab.go:384-393 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) internal/forge/gitlab/gitlab.go:273 — internal/forge/gitlab/gitlab.go:273-282 | internal/forge/jira/client.go:479-488 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) internal/forge/jira/adf.go:907 — internal/forge/jira/adf.go:907-916 | internal/jirapoll/discover.go:480-489 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:657 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:657-666 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:990-999 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 2) internal/repos/converge.go:3521 — internal/repos/converge.go:3521-3530 | internal/repos/converge.go:3576-3585 — both copies are in the same file, so extract the 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 `internal/repos/converge.go:3521` 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 (10 lines × 2) internal/forge/gitlab/hooks.go:215 — internal/forge/gitlab/hooks.go:215-224 | internal/forge/gitlab/hooks.go:261-270 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/hooks.go:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:1252 — REDACTED:1252-1261 | REDACTED:1289-1298 — both copies are in the same file, so extract the 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:1252` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:2614 — REDACTED:2614-2623 | REDACTED:2640-2649 — both copies are in the same file, so extract the 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:2614` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/e2etest/cleanup.go:224 — internal/e2etest/cleanup.go:224-233 | internal/e2etest/cleanup.go:255-264 — both copies are in the same file, so extract the 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 `internal/e2etest/cleanup.go:224` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/cli/repos.go:1304 — internal/cli/repos.go:1304-1313 | internal/cli/repos.go:1315-1324 — both copies are in the same file, so extract the 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 `internal/cli/repos.go:1304` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×28
  • Duplicated block (12 lines × 2) internal/artifacts/prepare.go:153 — internal/artifacts/prepare.go:153-164 | internal/binary/download.go:325-336 — 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 `internal/artifacts/prepare.go:153` 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) internal/cli/checkprotectedbranch.go:78 — internal/cli/checkprotectedbranch.go:78-89 | internal/cli/resolvemrsource.go:110-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/cli/issues.go:345 — internal/cli/issues.go:345-356 | internal/cli/issues_transition.go:91-102 — 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 `internal/cli/issues.go:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/cli/issues.go:620 — internal/cli/issues.go:620-631 | internal/cli/issues.go:697-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/cli/mint.go:1314 — internal/cli/mint.go:1314-1325 | internal/cli/mint.go:1474-1485 — both copies are in the same file, so extract the 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 `internal/cli/mint.go:1314` 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) internal/cli/poll.go:136 — internal/cli/poll.go:136-147 | internal/cli/poll.go:269-280 — both copies are in the same file, so extract the 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 `internal/cli/poll.go:136` 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) internal/dispatch/gcf/gcp.go:892 — internal/dispatch/gcf/gcp.go:892-903 | internal/dispatch/gcf/gcp.go:981-992 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:892` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/dispatch/gcf/provisioner.go:443 — internal/dispatch/gcf/provisioner.go:443-454 | internal/dispatch/gcf/provisioner.go:483-494 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/provisioner.go:443` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/dispatch/gcf/provisioner.go:652 — internal/dispatch/gcf/provisioner.go:652-663 | internal/dispatch/gcf/provisioner.go:1753-1764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/evalmeasure/export_local.go:22 — internal/evalmeasure/export_local.go:22-33 | internal/evalmeasure/export_local.go:69-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 2) REDACTED:1833 — REDACTED:1833-1844 | REDACTED:1858-1869 — both copies are in the same file, so extract the 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:1833` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/gitlabroles/readiness.go:79 — internal/gitlabroles/readiness.go:79-90 | internal/gitlabroles/readiness.go:131-142 — both copies are in the same file, so extract the 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 `internal/gitlabroles/readiness.go:79` 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 × 2) internal/harness/compose.go:791 — internal/harness/compose.go:791-803 | internal/resolve/resolve.go:638-649 — 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 `internal/harness/compose.go:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/harness/compose.go:2188 — internal/harness/compose.go:2188-2200 | internal/harness/compose.go:2391-2402 — both copies are in the same file, so extract the 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 (12 lines × 2) internal/harness/discover.go:70 — internal/harness/discover.go:70-81 | internal/harness/discover_remote.go:65-76 — 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 `internal/harness/discover.go:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/repos/gitlab_roles_rotate.go:1670 — internal/repos/gitlab_roles_rotate.go:1670-1681 | internal/repos/gitlab_webhook_poller.go:712-723 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) internal/resolve/resolve.go:642 — internal/resolve/resolve.go:642-653 | internal/resolve/resolve.go:775-786 — both copies are in the same file, so extract the 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 `internal/resolve/resolve.go:642` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/runtime/opencode_run.go:487 — internal/runtime/opencode_run.go:487-498 | internal/runtime/pi_run.go:1262-1273 — 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 `internal/runtime/opencode_run.go:487` 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: `internal/runtime/pi_run.go:1262` is reached only past a guard at line 1222 that tests `params.ModelAliases` and leaves the function early, and `internal/runtime/opencode_run.go:487` reads `params.ModelAliases` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
  • Duplicated block (12 lines × 2) internal/tracker/forge_client.go:42 — internal/tracker/forge_client.go:42-53 | internal/tracker/forge_client.go:72-83 — both copies are in the same file, so extract the 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 `internal/tracker/forge_client.go:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:86 — pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:86-97 | pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go:88-99 — 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/behaviourtest/drivers/install/repopool_cfmint_previews.go:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:83` calls `startTraceCollector`, `logf` and `pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go:86` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) pkg/behaviourtest/steps/dispatch.go:79 — pkg/behaviourtest/steps/dispatch.go:79-90 | pkg/behaviourtest/steps/dispatch.go:107-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:891 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:891-902 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:113-124 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) internal/jirapoll/discover.go:151 — internal/jirapoll/discover.go:151-162 | internal/jirapoll/discover.go:200-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/jirapoll/discover.go:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1498 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1498-1512 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:621-632 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1498` 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 (12 lines × 2) internal/security/unicode.go:86 — internal/security/unicode.go:86-97 | internal/security/unicode.go:252-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/security/unicode.go:86` 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×27
  • Duplicated block (11 lines × 2) internal/celtrigger/celtrigger.go:53 — internal/celtrigger/celtrigger.go:53-63 | internal/harness/trigger.go:51-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/cli/admin.go:1337 — internal/cli/admin.go:1337-1347 | internal/layers/preflight.go:141-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) internal/cli/lock.go:1557 — internal/cli/lock.go:1557-1567 | REDACTED:64-74 — 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 (11 lines × 2) internal/cli/postcomment.go:77 — internal/cli/postcomment.go:77-87 | REDACTED:164-174 — 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 `internal/cli/postcomment.go:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/dispatch/gcf/provisioner.go:806 — internal/dispatch/gcf/provisioner.go:806-816 | internal/dispatch/gcf/provisioner.go:1094-1104 — both copies are in the same file, so extract the 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) REDACTED:3054 — REDACTED:3054-3064 | REDACTED:3080-3090 — both copies are in the same file, so extract the 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:3054` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) REDACTED:4854 — REDACTED:4854-4864 | REDACTED:4952-4962 — both copies are in the same file, so extract the 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:4854` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/forge/gitlab/ci.go:1703 — internal/forge/gitlab/ci.go:1703-1713 | internal/forge/gitlab/ci.go:1764-1774 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/ci.go:1703` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/forge/url.go:38 — internal/forge/url.go:38-48 | internal/forge/url.go:219-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/gitlablifecycle/trigger_account.go:231 — internal/gitlablifecycle/trigger_account.go:231-241 | internal/gitlablifecycle/trigger_account.go:281-291 — both copies are in the same file, so extract the 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 `internal/gitlablifecycle/trigger_account.go:231` 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 (11 lines × 2) internal/harness/compose.go:1207 — internal/harness/compose.go:1207-1217 | internal/harness/compose.go:1271-1281 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/poll/events.go:396 — internal/poll/events.go:396-406 | internal/poll/events.go:435-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/poll/events.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.
  • Duplicated block (11 lines × 2) internal/poll/state.go:625 — internal/poll/state.go:625-635 | internal/poll/state.go:1422-1432 — both copies are in the same file, so extract the 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) internal/repos/converge.go:1764 — internal/repos/converge.go:1764-1774 | internal/repos/converge.go:3346-3356 — both copies are in the same file, so extract the 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 `internal/repos/converge.go:1764` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/repos/gitlab_webhook.go:1376 — internal/repos/gitlab_webhook.go:1376-1386 | internal/repos/gitlab_webhook.go:1538-1548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/repos/gitlab_webhook.go:1376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/runtime/codex_run.go:595 — internal/runtime/codex_run.go:595-605 | internal/runtime/opencode_run.go:449-459 — 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 `internal/runtime/codex_run.go:595` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:123 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:123-133 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:149-159 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:469 — pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:469-479 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:681-691 — both copies are in the same file, so extract the 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/behaviourtest/drivers/ci/gitlabci/gitlabci.go:469` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) REDACTED:511 — REDACTED:511-521 | REDACTED:545-555 — both copies are in the same file, so extract the 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/behaviourtest/report.go:304 — pkg/behaviourtest/report.go:304-314 | pkg/behaviourtest/steps/debuglogs.go:1026-1036 — 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/behaviourtest/report.go:304` 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) internal/dispatch/gcf/provisioner.go:1336 — internal/dispatch/gcf/provisioner.go:1336-1346 | internal/dispatch/gcf/provisioner.go:1389-1399 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/provisioner.go:1336` 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) internal/poll/events.go:245 — internal/poll/events.go:245-255 | internal/poll/events.go:416-426 — both copies are in the same file, so extract the 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 `internal/poll/events.go:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:164 — pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:164-174 | pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go:162-172 — 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/behaviourtest/drivers/install/repopool_cfmint_previews.go:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:3310 — REDACTED:3310-3320 | REDACTED:3377-3387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) REDACTED:1143 — REDACTED:1143-1153 | REDACTED:1170-1180 — both copies are in the same file, so extract the 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:1143` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×24
  • Duplicated block (6 lines × 2) internal/cli/foreign.go:109 — internal/cli/foreign.go:109-114 | internal/cli/foreign.go:347-352 — both copies are in the same file, so extract the 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 `internal/cli/foreign.go:109` 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 (6 lines × 2) internal/mintcore/github.go:733 — internal/mintcore/github.go:733-738 | internal/mintcore/github.go:765-770 — both copies are in the same file, so extract the 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 `internal/mintcore/github.go:733` 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) internal/repos/gitlab_roles_rotate.go:871 — internal/repos/gitlab_roles_rotate.go:871-876 | internal/repos/gitlab_roles_rotate.go:881-886 — both copies are in the same file, so extract the 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 `internal/repos/gitlab_roles_rotate.go:871` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) cmd/mint/proxy.go:27 — cmd/mint/proxy.go:27-32 | internal/mintcore/handler.go:948-953 — 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. Check import visibility before settling on that home: `internal/mintcore/handler.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (6 lines × 2) REDACTED:2158 — REDACTED:2158-2163 | REDACTED:36-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) REDACTED:1921 — REDACTED:1921-1930 | REDACTED:1947-1952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1921` 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 × 2) internal/repos/status.go:782 — internal/repos/status.go:782-788 | internal/repos/status.go:798-803 — both copies are in the same file, so extract the 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 `internal/repos/status.go:782` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:4236 — REDACTED:4236-4241 | REDACTED:4365-4370 — both copies are in the same file, so extract the 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:4236` 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/behaviourtest/steps/dispatch.go:91 — pkg/behaviourtest/steps/dispatch.go:91-96 | pkg/behaviourtest/steps/dispatch.go:154-159 — both copies are in the same file, so extract the 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/behaviourtest/steps/dispatch.go:91` 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/behaviourtest/steps/bot_role_probe.go:300 — pkg/behaviourtest/steps/bot_role_probe.go:300-305 | pkg/behaviourtest/steps/mint_probe.go:434-439 — 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/behaviourtest/steps/bot_role_probe.go:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/cli/repos_gitlab.go:642 — internal/cli/repos_gitlab.go:642-647 | internal/cli/repos_gitlab.go:681-686 — both copies are in the same file, so extract the 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 `internal/cli/repos_gitlab.go:642` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/repos/gitlab_poller_credential_policy.go:203 — internal/repos/gitlab_poller_credential_policy.go:203-208 | internal/repos/gitlab_poller_credential_policy.go:210-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/repos/gitlab_poller_credential_policy.go:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) internal/agentnew/render.go:228 — internal/agentnew/render.go:228-233 | internal/agentnew/render.go:255-260 — both copies are in the same file, so extract the 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 `internal/agentnew/render.go:228` 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) internal/forge/gitlab/poll.go:68 — internal/forge/gitlab/poll.go:68-73 | internal/forge/gitlab/poll.go:98-103 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/poll.go:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) internal/runtime/dummy.go:286 — internal/runtime/dummy.go:286-291 | REDACTED:295-300 — 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 `internal/runtime/dummy.go:286` 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) internal/runtime/codex_bootstrap.go:523 — internal/runtime/codex_bootstrap.go:523-528 | internal/runtime/codex_bootstrap.go:634-639 — both copies are in the same file, so extract the 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 `internal/runtime/codex_bootstrap.go:523` 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 (6 lines × 2) internal/harness/forge.go:77 — internal/harness/forge.go:77-82 | internal/harness/forge.go:158-163 — both copies are in the same file, so extract the 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 `internal/harness/forge.go:77` 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) internal/repos/gitlab_webhook.go:2371 — internal/repos/gitlab_webhook.go:2371-2376 | internal/repos/gitlab_webhook_trigger_account.go:379-384 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) internal/cli/repos_gitlab.go:663 — internal/cli/repos_gitlab.go:663-668 | internal/cli/repos_gitlab.go:690-695 — both copies are in the same file, so extract the 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 `internal/cli/repos_gitlab.go:663` 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 (6 lines × 2) pkg/behaviourtest/steps/cleanup.go:150 — pkg/behaviourtest/steps/cleanup.go:150-155 | pkg/behaviourtest/steps/cleanup.go:209-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/cleanup.go:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/behaviourtest/drivers/install/ensure.go:574 — pkg/behaviourtest/drivers/install/ensure.go:574-579 | pkg/behaviourtest/drivers/install/ensure.go:616-621 — both copies are in the same file, so extract the 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/behaviourtest/drivers/install/ensure.go:574` 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) internal/cli/repos_gitlab_service_accounts.go:302 — internal/cli/repos_gitlab_service_accounts.go:302-307 | internal/gitlablifecycle/trigger_account.go:69-74 — 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 (6 lines × 2) internal/gitlabroles/readiness.go:73 — internal/gitlabroles/readiness.go:73-78 | internal/gitlabroles/readiness.go:320-325 — both copies are in the same file, so extract the 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 `internal/gitlabroles/readiness.go:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) skills/nextwork/scripts/nextwork.py:144 — skills/nextwork/scripts/nextwork.py:144-149 | skills/topissues/scripts/topissues.py:112-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×23
  • Duplicated block (5 lines × 2) internal/cli/inference.go:165 — internal/cli/inference.go:165-169 | internal/cli/inference.go:640-644 — both copies are in the same file, so extract the 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 `internal/cli/inference.go:165` 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) internal/cli/mint.go:1496 — internal/cli/mint.go:1496-1500 | internal/cli/mint_setup.go:173-177 — 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 `internal/cli/mint.go:1496` 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) internal/cli/run.go:8444 — internal/cli/run.go:8444-8448 | internal/harness/registry.go:85-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:8444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/harness/compose.go:2105 — internal/harness/compose.go:2105-2109 | internal/harness/compose.go:2283-2287 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:2105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/repos/converge.go:816 — internal/repos/converge.go:816-820 | internal/repos/managed_config_writeback.go:77-81 — 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 `internal/repos/converge.go:816` 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) internal/repos/gitlab_roles.go:545 — internal/repos/gitlab_roles.go:545-549 | internal/repos/gitlab_roles_rotate.go:1123-1130 — 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 `internal/repos/gitlab_roles.go:545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/repos/gitlab_roles_cleanup.go:575 — internal/repos/gitlab_roles_cleanup.go:575-579 | internal/repos/gitlab_service_accounts.go:303-307 — 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 `internal/repos/gitlab_roles_cleanup.go:575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/repos/gitlab_trigger_account.go:983 — internal/repos/gitlab_trigger_account.go:983-987 | internal/repos/gitlab_trigger_account.go:1169-1173 — both copies are in the same file, so extract the 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 `internal/repos/gitlab_trigger_account.go:983` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/repos/gitlab_trigger_account.go:1791 — internal/repos/gitlab_trigger_account.go:1791-1795 | internal/repos/gitlab_trigger_schedules.go:683-687 — 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) internal/runtime/codex_bootstrap.go:521 — internal/runtime/codex_bootstrap.go:521-526 | internal/runtime/pi_bootstrap.go:975-979 — 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 `internal/runtime/codex_bootstrap.go:521` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/repos/gitlab_roles.go:517 — internal/repos/gitlab_roles.go:517-522 | internal/repos/gitlab_roles_rotate.go:1082-1086 — 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 `internal/repos/gitlab_roles.go:517` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/cli/inference.go:661 — internal/cli/inference.go:661-665 | internal/cli/inference.go:671-675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/inference.go:658` calls `SplitN`, `BuildRepoProviderID` and `internal/cli/inference.go:669` 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) REDACTED:553 — REDACTED:553-557 | REDACTED:1521-1525 — both copies are in the same file, so extract the 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:553` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/gitlablifecycle/poller_retirement.go:88 — internal/gitlablifecycle/poller_retirement.go:88-92 | internal/gitlablifecycle/trigger_owner.go:758-762 — 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 `internal/gitlablifecycle/poller_retirement.go:88` 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) internal/forge/jira/client.go:821 — internal/forge/jira/client.go:821-825 | internal/forge/jira/client.go:918-922 — both copies are in the same file, so extract the 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 `internal/forge/jira/client.go:821` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/harness/skill_entry.go:180 — internal/harness/skill_entry.go:180-184 | internal/harness/skill_entry.go:208-212 — both copies are in the same file, so extract the 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 `internal/harness/skill_entry.go:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/harness/compose.go:1874 — internal/harness/compose.go:1874-1878 | internal/resolve/resolve.go:755-759 — 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 `internal/harness/compose.go: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.
  • Duplicated block (5 lines × 2) internal/repos/converge.go:2642 — internal/repos/converge.go:2642-2646 | internal/repos/converge.go:2651-2655 — both copies are in the same file, so extract the 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 `internal/repos/converge.go:2642` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/harness/compose.go:2285 — internal/harness/compose.go:2285-2289 | internal/resolve/resolve.go:741-745 — 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 `internal/harness/compose.go:2285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/gitlablifecycle/trigger_owner.go:373 — internal/gitlablifecycle/trigger_owner.go:373-377 | internal/gitlablifecycle/trigger_owner.go:407-411 — both copies are in the same file, so extract the 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 `internal/gitlablifecycle/trigger_owner.go:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/harnessdispatch/input/ghaevent.go:85 — internal/harnessdispatch/input/ghaevent.go:85-89 | internal/harnessdispatch/input/ghaevent.go:298-302 — both copies are in the same file, so extract the 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 `internal/harnessdispatch/input/ghaevent.go:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/repos/gitlab_workflow_admission.go:337 — internal/repos/gitlab_workflow_admission.go:337-341 | internal/repos/gitlab_workflow_admission.go:414-418 — both copies are in the same file, so extract the 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 `internal/repos/gitlab_workflow_admission.go:337` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/sandbox/sandbox.go:2547 — internal/sandbox/sandbox.go:2547-2552 | internal/sandbox/sandbox.go:2578-2582 — both copies are in the same file, so extract the 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 `internal/sandbox/sandbox.go:2547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/sandbox/sandbox.go:2545` calls `removeReplacementRefs` and `internal/sandbox/sandbox.go:2575` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×20
  • Edited copy of a member (10 corresponding lines) internal/cli/gitlab_profile.go:651 — internal/cli/gitlab_profile.go:651-660 | internal/repos/manifest_legacy_tracking.go:324-334 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/repos/gitlab_jira_poll.go:229 — internal/repos/gitlab_jira_poll.go:229-242 | internal/repos/gitlab_trigger_schedules.go:597-606 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/behaviourtest/drivers/install/slotgc.go:280 — pkg/behaviourtest/drivers/install/slotgc.go:280-289 | REDACTED:1077-1086 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/gitlab_profile.go:686 — internal/cli/gitlab_profile.go:686-695 | internal/repos/managed_config_adoption.go:99-110 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/repos_gitlab.go:336 — internal/cli/repos_gitlab.go:336-345 | internal/cli/repos_gitlab.go:399-410 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/forge/gitlab/ci.go:1371 — internal/forge/gitlab/ci.go:1371-1380 | internal/forge/gitlab/ci.go:1479-1491 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/run.go:3739 — internal/cli/run.go:3739-3749 | internal/cli/run.go:4991-5000 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/forge/gitlab/gitlab.go:406 — internal/forge/gitlab/gitlab.go:406-415 | REDACTED:1133-1142 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/forge/gitlab/ci.go:177 — internal/forge/gitlab/ci.go:177-186 | internal/repos/gitlab_roles.go:320-331 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/telemetry/fileexporter.go:316 — internal/telemetry/fileexporter.go:316-325 | internal/telemetry/fileexporter.go:327-338 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:923 — REDACTED:923-932 | internal/forge/gitlab/gitlab.go:373-382 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/persona_manifest.go:214 — internal/cli/persona_manifest.go:214-223 | internal/cli/run.go:6092-6101 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/repos/gitlabci.go:2032 — internal/repos/gitlabci.go:2032-2041 | internal/repos/openai_wif.go:193-202 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/run_gateway_egress.go:223 — internal/cli/run_gateway_egress.go:223-232 | internal/cli/run_jira.go:318-327 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:237 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:237-246 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:832-841 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/sticky/sticky.go:338 — internal/sticky/sticky.go:338-355 | internal/cli/run.go:4608-4617 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/runner_secrets.go:321 — internal/cli/runner_secrets.go:321-330 | internal/mintcore/handler.go:896-908 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/behaviourtest/drivers/install/common/setup.go:351 — pkg/behaviourtest/drivers/install/common/setup.go:351-360 | pkg/behaviourtest/steps/mint_probe.go:573-585 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/skill_staging.go:96 — internal/cli/skill_staging.go:96-105 | internal/harness/skill_entry.go:120-129 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/sandbox/sandbox.go:972 — internal/sandbox/sandbox.go:972-984 | internal/sandbox/sandbox.go:993-1002 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · TooManyMethods · ×17
  • TooManyMethods: LiveClient internal/forge/gitlab/gitlab.go:24 — TooManyMethods — 198 methods, declared across 8 files: gitlab/ci.go (66), REDACTED (44), gitlab/issue.go (25), gitlab/mr.go (25), +4 more file(s). 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: LiveClient REDACTED:46 — TooManyMethods — 183 methods, declared across 2 files: REDACTED (179), github/commit_graphql.go (4). The bar is 30 methods; this is 153 over it, 6.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement forge.Client (129 of 183 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: FakeClient REDACTED:214 — TooManyMethods — 142 methods. The bar is 30 methods; this is 112 over it, 4.73× 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: FakeClient REDACTED:214 — TooManyMethods — 142 methods. The bar is 30 methods; this is 112 over it, 4.73× the bar. Most of these members implement forge.Client (129 of 142 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: gitLabTriggerAccountOp internal/repos/gitlab_trigger_account.go:372 — TooManyMethods — 64 methods, declared across 3 files: repos/gitlab_trigger_account.go (46), repos/gitlab_trigger_schedules.go (16), repos/gitlab_trigger_account_status.go (2). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Poller internal/poll/poll.go:17 — TooManyMethods — 61 methods, declared across 8 files: poll/state.go (29), poll/events.go (10), poll/webhook.go (7), poll/convert.go (6), +4 more file(s). The bar is 30 methods; this is 31 over it, 2.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.
  • TooManyMethods: perRepoConfig internal/config/config.go:951 — TooManyMethods — 57 methods, declared across 3 files: config/interfaces.go (48), config/config.go (6), config/artifacts.go (3). The bar is 30 methods; this is 27 over it, 1.90× 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: TriggerOwner internal/gitlablifecycle/trigger_owner.go:35 — TooManyMethods — 53 methods, declared across 4 files: gitlablifecycle/trigger_owner.go (36), gitlablifecycle/poller_handoff.go (9), gitlablifecycle/trigger_account.go (5), gitlablifecycle/poller_retirement.go (3). The bar is 30 methods; this is 23 over it, 1.77× 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: slotAllocator REDACTED:283 — TooManyMethods — 47 methods, declared across 2 files: REDACTED (27), install/slotgc.go (20). The bar is 30 methods; this is 17 over it, 1.57× 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: Provisioner internal/dispatch/gcf/provisioner.go:284 — TooManyMethods — 45 methods, declared across 2 files: gcf/provisioner.go (44), gcf/gitlab_wif.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: LiveGCFClient internal/dispatch/gcf/gcp.go:226 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. Most of these members implement gcf.GCFClient (32 of 42 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: CodexRuntime internal/runtime/codex.go:23 — TooManyMethods — 36 methods, declared across 6 files: runtime/codex.go (11), runtime/codex_bootstrap.go (10), runtime/codex_gateway.go (6), runtime/codex_transcript.go (5), +2 more file(s). The bar is 30 methods; this is 6 over it, 1.20× 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: Driver pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:73 — 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: Harness REDACTED:377 — TooManyMethods — 35 methods, declared across 7 files: REDACTED (21), harness/forge.go (4), harness/lint.go (4), harness/plugin_spec.go (2), +3 more file(s). The bar is 30 methods; this is 5 over it, 1.17× 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: fakeGCFClient internal/dispatch/gcf/fakeclient.go:10 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. Most of these members implement gcf.GCFClient (32 of 33 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: Manifest REDACTED:111 — TooManyMethods — 31 methods, declared across 3 files: REDACTED (27), repos/managed_config.go (3), repos/manifest_legacy_tracking.go (1). 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.
  • TooManyMethods: Driver pkg/behaviourtest/drivers/scm/github/github.go:21 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×16
  • Duplicated block (13 lines × 2) internal/artifacts/telemetry.go:213 — internal/artifacts/telemetry.go:213-225 | internal/artifacts/telemetry.go:237-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/artifacts/telemetry.go:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/cli/mint.go:774 — internal/cli/mint.go:774-786 | internal/cli/mint_delete.go:120-132 — 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 `internal/cli/mint.go:774` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/dispatch/gcf/provisioner.go:1984 — internal/dispatch/gcf/provisioner.go:1984-1996 | internal/dispatch/gcf/provisioner.go:2140-2152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/fetch/cache.go:506 — internal/fetch/cache.go:506-518 | internal/repos/manifest_set.go:217-229 — 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 `internal/fetch/cache.go:506` 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) internal/forge/url.go:77 — internal/forge/url.go:77-89 | internal/forge/url.go:250-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/forge/url.go:92` calls `Errorf` and `internal/forge/url.go:264` 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 (13 lines × 2) internal/harness/compose.go:1392 — internal/harness/compose.go:1392-1404 | internal/harness/compose.go:1428-1440 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/harness/discover.go:56 — internal/harness/discover.go:56-68 | internal/harness/discover_remote.go:52-64 — 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 `internal/harness/discover.go:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/repos/converge.go:3106 — internal/repos/converge.go:3106-3118 | internal/repos/converge.go:3240-3252 — both copies are in the same file, so extract the 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 `internal/repos/converge.go:3106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:696 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:696-708 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:725-737 — both copies are in the same file, so extract the 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/behaviourtest/drivers/ci/githubactions/githubactions.go:696` 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 (13 lines × 2) pkg/behaviourtest/run.go:56 — pkg/behaviourtest/run.go:56-68 | pkg/behaviourtest/run_playback.go:71-83 — 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/behaviourtest/run.go:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/behaviourtest/run_playback.go:86` calls `NewPlaybackDriver` and `pkg/behaviourtest/run.go:75` 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 (13 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:188 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:188-200 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:818-830 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `workflowFile` in one and `agent` 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.
  • Duplicated block (13 lines × 2) internal/jirapoll/poller.go:626 — internal/jirapoll/poller.go:626-638 | internal/poll/events.go:672-684 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) REDACTED:3941 — REDACTED:3941-3953 | REDACTED:3974-3986 — both copies are in the same file, so extract the 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:3941` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/dispatch/gcf/gcp.go:2063 — internal/dispatch/gcf/gcp.go:2063-2075 | internal/dispatch/gcf/gcp.go:2134-2146 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:2063` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/forge/gitlab/poll.go:180 — internal/forge/gitlab/poll.go:180-192 | internal/forge/gitlab/poll.go:210-222 — both copies are in the same file, so extract the 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 `internal/forge/gitlab/poll.go:180` 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 (13 lines × 2) internal/harness/compose.go:2167 — internal/harness/compose.go:2167-2179 | internal/harness/compose.go:2329-2341 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:2167` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×14
  • Edited copy of a member (12 corresponding lines) internal/envmanifest/schema.go:248 — internal/envmanifest/schema.go:248-259 | internal/envmanifest/schema.go:261-272 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/forge/jira/client.go:818 — internal/forge/jira/client.go:818-829 | internal/forge/jira/client.go:915-926 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/runtime/dummy.go:284 — internal/runtime/dummy.go:284-295 | REDACTED:293-304 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:2677 — REDACTED:2677-2689 | REDACTED:677-688 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:3680 — REDACTED:3680-3692 | internal/forge/gitlab/issue.go:181-192 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/repos/gitlab_webhook.go:83 — internal/repos/gitlab_webhook.go:83-94 | internal/repos/gitlab_webhook.go:1752-1766 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/repos/gitlab_webhook.go:1893 — internal/repos/gitlab_webhook.go:1893-1904 | internal/repos/gitlab_webhook_poller.go:237-251 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/tracker/forge_client.go:87 — internal/tracker/forge_client.go:87-101 | internal/tracker/jira_client.go:210-221 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/cli/run.go:8241 — internal/cli/run.go:8241-8252 | internal/cli/run.go:8279-8290 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/config/managed_safety.go:290 — internal/config/managed_safety.go:290-307 | REDACTED:1778-1789 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/behaviourtest/steps/bot_role_probe.go:407 — pkg/behaviourtest/steps/bot_role_probe.go:407-418 | pkg/behaviourtest/steps/mint_probe.go:683-694 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/evalmeasure/export_otlp.go:347 — internal/evalmeasure/export_otlp.go:347-358 | internal/evalmeasure/export_otlp.go:360-371 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/layers/layers.go:131 — internal/layers/layers.go:131-143 | internal/runtime/pi_personas.go:691-702 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:133 — pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:133-150 | pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go:137-148 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · ClassTooLong · ×13
  • ClassTooLong: LiveClient REDACTED:46 — ClassTooLong — 2743 significant lines (blank, comment-only and punctuation-only lines excluded), 183 methods, 175 blocks, lines 46-5802. The bar is 400 significant lines; this is 2343 over it, 6.86× 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: FakeClient REDACTED:214 — ClassTooLong — 1969 significant lines (blank, comment-only and punctuation-only lines excluded), 142 methods, 143 blocks, lines 214-3375. The bar is 400 significant lines; this is 1569 over it, 4.92× 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: LiveGCFClient internal/dispatch/gcf/gcp.go:226 — ClassTooLong — 1145 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods, 43 blocks, lines 226-2187. The bar is 400 significant lines; this is 745 over it, 2.86× 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: Provisioner internal/dispatch/gcf/provisioner.go:284 — ClassTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods, 45 blocks, lines 219-2264. The bar is 400 significant lines; this is 391 over it, 1.98× 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: gitLabTriggerAccountOp internal/repos/gitlab_trigger_account.go:372 — ClassTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods, 47 blocks, lines 372-2104. The bar is 400 significant lines; this is 332 over it, 1.83× 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: Driver pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:73 — ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods, 36 blocks, lines 73-2078. The bar is 400 significant lines; this is 217 over it, 1.54× 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: Harness REDACTED:377 — ClassTooLong — 486 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods, 22 blocks, lines 247-1396. The bar is 400 significant lines; this is 86 over it, 1.22× 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: Manifest REDACTED:111 — ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods, 28 blocks, lines 111-2026. The bar is 400 significant lines; this is 75 over it, 1.19× 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: slotAllocator REDACTED:283 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods, 28 blocks, lines 283-1184. The bar is 400 significant lines; this is 70 over it, 1.18× 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: Handler internal/mintcore/handler.go:65 — ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods, 16 blocks, lines 65-933. The bar is 400 significant lines; this is 51 over it, 1.13× 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: Setup internal/appsetup/appsetup.go:130 — ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 20 blocks, lines 130-1031. The bar is 400 significant lines; this is 32 over it, 1.08× 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: TriggerOwner internal/gitlablifecycle/trigger_owner.go:35 — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods, 37 blocks, lines 35-927. The bar is 400 significant lines; this is 30 over it, 1.08× 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: ServiceAccountTokenClient internal/repos/gitlab_service_accounts.go:55 — ClassTooLong — 424 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods, 18 blocks, lines 55-1097. The bar is 400 significant lines; this is 24 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · MethodTooLong · ×13
  • MethodTooLong: Poller.Run internal/poll/poll.go:74 — MethodTooLong — Run runs 353 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 253 over it, 3.53× 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: Poller.discoverAllEvents internal/poll/events.go:73 — MethodTooLong — discoverAllEvents runs 219 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 119 over it, 2.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: slotAllocator.Claim REDACTED:408 — MethodTooLong — Claim runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× 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: Provisioner.provisionSelfManaged internal/dispatch/gcf/provisioner.go:824 — MethodTooLong — provisionSelfManaged runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: Handler.serveHTTP internal/mintcore/handler.go:236 — MethodTooLong — serveHTTP runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UnicodeNormalizer.Scan internal/security/unicode.go:64 — MethodTooLong — Scan runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: LiveClient.commitFilesTo REDACTED:1762 — MethodTooLong — commitFilesTo runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: LiveClient.ListPullRequestReviewThreads REDACTED:4527 — MethodTooLong — ListPullRequestReviewThreads runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CodexRuntime.Run internal/runtime/codex_run.go:519 — MethodTooLong — Run runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.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: LiveClient.ListPullRequestReviewThreads internal/forge/gitlab/mr.go:878 — MethodTooLong — ListPullRequestReviewThreads runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CodexRuntime.Bootstrap internal/runtime/codex_bootstrap.go:131 — MethodTooLong — Bootstrap runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: LiveGCFClient.GetServiceRevisionInfo internal/dispatch/gcf/gcp.go:1862 — MethodTooLong — GetServiceRevisionInfo runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× 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: pollerGenerationRun.attemptTrigger internal/repos/gitlab_poller_generation.go:794 — MethodTooLong — attemptTrigger 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.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×12
  • Edited copy of a member (16 corresponding lines) REDACTED:1006 — REDACTED:1006-1034 | REDACTED:1041-1056 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/forge/gitlab/gitlab.go:289 — internal/forge/gitlab/gitlab.go:289-304 | internal/forge/jira/client.go:500-515 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) REDACTED:4063 — REDACTED:4063-4078 | REDACTED:4086-4101 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/behaviourtest/steps/forge_state.go:80 — pkg/behaviourtest/steps/forge_state.go:80-95 | pkg/behaviourtest/steps/forge_state.go:99-114 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/evalmeasure/export_local.go:18 — internal/evalmeasure/export_local.go:18-41 | internal/evalmeasure/export_local.go:68-83 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/cli/run.go:8469 — internal/cli/run.go:8469-8484 | internal/cli/run.go:8486-8501 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/mintcore/github.go:846 — internal/mintcore/github.go:846-861 | internal/mintcore/github.go:866-881 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/forge/gitlab/poll.go:438 — internal/forge/gitlab/poll.go:438-453 | internal/forge/gitlab/service_accounts.go:254-269 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/repos/gitlabci.go:1366 — internal/repos/gitlabci.go:1366-1381 | internal/repos/gitlabci.go:1385-1400 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/envmanifest/schema.go:309 — internal/envmanifest/schema.go:309-330 | internal/runtime/opencode_bootstrap.go:337-352 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/runtime/codex_bootstrap.go:381 — internal/runtime/codex_bootstrap.go:381-396 | internal/runtime/pi_bootstrap.go:472-487 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/behaviourtest/drivers/jiramock/server.go:455 — pkg/behaviourtest/drivers/jiramock/server.go:455-470 | pkg/behaviourtest/drivers/jiramock/server.go:472-494 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×12
  • Edited copy of a member (14 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:917 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:917-930 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:130-143 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/runtime/dummy.go:312 — internal/runtime/dummy.go:312-325 | REDACTED:320-336 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/forge/gitlab/ci.go:776 — internal/forge/gitlab/ci.go:776-795 | internal/forge/gitlab/ci.go:798-811 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:1858 — REDACTED:1858-1874 | REDACTED:1878-1891 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:698 — REDACTED:698-713 | REDACTED:805-818 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/dispatch/gcf/provisioner.go:1133 — internal/dispatch/gcf/provisioner.go:1133-1146 | internal/dispatch/gcf/provisioner.go:1150-1165 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/cli/runner_secrets.go:334 — internal/cli/runner_secrets.go:334-347 | internal/cli/runner_secrets.go:487-503 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:2668 — REDACTED:2668-2681 | REDACTED:3344-3360 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/poll/state.go:1855 — internal/poll/state.go:1855-1868 | internal/poll/state.go:1880-1893 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:525 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:525-541 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:543-556 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/repos/gitlab_trigger_jobs.go:111 — internal/repos/gitlab_trigger_jobs.go:111-124 | internal/repos/gitlab_webhook.go:1419-1432 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/cli/issues.go:1011 — internal/cli/issues.go:1011-1024 | internal/sticky/sticky.go:147-160 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×12
  • Edited copy of a member (13 corresponding lines) skills/nextwork/scripts/nextwork.py:1208 — skills/nextwork/scripts/nextwork.py:1208-1220 | skills/topissues/scripts/topissues.py:318-334 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/deploy_identity.go:58 — internal/cli/deploy_identity.go:58-72 | internal/cli/tirith_repo_policy.go:197-209 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:881 — REDACTED:881-897 | REDACTED:903-915 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/forge/gitlab/hooks.go:212 — internal/forge/gitlab/hooks.go:212-224 | internal/forge/gitlab/hooks.go:258-270 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:2342 — REDACTED:2342-2354 | REDACTED:2372-2384 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/repos/gitlab_webhook_status.go:283 — internal/repos/gitlab_webhook_status.go:283-295 | internal/repos/status.go:542-554 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/dispatch/gcf/gitlab_wif.go:93 — internal/dispatch/gcf/gitlab_wif.go:93-105 | internal/mintcore/wif.go:16-30 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) skills/adr-corner/scripts/adr_corner.py:452 — skills/adr-corner/scripts/adr_corner.py:452-464 | skills/topissues/scripts/topissues.py:399-418 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:1523 — REDACTED:1523-1535 | REDACTED:1603-1618 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/run_openai.go:627 — internal/cli/run_openai.go:627-640 | internal/cli/run_openai.go:647-659 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/mint.go:145 — internal/cli/mint.go:145-157 | internal/runtime/pi_personas.go:596-610 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/admin.go:191 — internal/cli/admin.go:191-204 | internal/repos/managed_config.go:476-488 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×12
  • Edited copy of a member (11 corresponding lines) internal/repos/gitlab_trigger_job_templates.go:39 — internal/repos/gitlab_trigger_job_templates.go:39-49 | internal/repos/gitlabci.go:324-336 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/cli/repos_gitlab.go:474 — internal/cli/repos_gitlab.go:474-486 | internal/gitlablifecycle/trigger_account.go:108-118 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/cli/lock.go:193 — internal/cli/lock.go:193-203 | internal/cli/orgconfig.go:68-79 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/e2etest/testutil.go:545 — internal/e2etest/testutil.go:545-555 | internal/e2etest/testutil.go:558-572 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/layers/layers.go:104 — internal/layers/layers.go:104-114 | internal/layers/layers.go:146-159 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/gitlablifecycle/trigger_owner.go:293 — internal/gitlablifecycle/trigger_owner.go:293-303 | internal/gitlablifecycle/trigger_owner.go:447-457 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/repos/gitlab_poller_generation.go:431 — internal/repos/gitlab_poller_generation.go:431-443 | internal/repos/managed_config.go:98-108 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/repos/install.go:735 — internal/repos/install.go:735-747 | internal/repos/install.go:749-759 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/repos/gitlab_webhook.go:382 — internal/repos/gitlab_webhook.go:382-392 | internal/repos/gitlab_webhook_trigger_account.go:244-254 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:1894 — REDACTED:1894-1904 | internal/repos/ref_ops.go:254-264 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/dispatch/gcf/provisioner.go:1178 — internal/dispatch/gcf/provisioner.go:1178-1188 | internal/repos/gitlab_roles_rotate.go:1831-1841 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/sandbox/sandbox.go:2414 — internal/sandbox/sandbox.go:2414-2424 | internal/sandbox/sandbox.go:2525-2540 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×12
  • Edited copy of a member (8 corresponding lines) internal/runtime/codex_run.go:760 — internal/runtime/codex_run.go:760-769 | internal/runtime/pi_run.go:1367-1374 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) skills/nextwork/scripts/nextwork.py:1247 — skills/nextwork/scripts/nextwork.py:1247-1254 | skills/topissues/scripts/topissues.py:338-349 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) REDACTED:634 — REDACTED:634-641 | REDACTED:645-652 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1552 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1552-1559 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:640-647 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/dispatch/gcf/provisioner.go:1401 — internal/dispatch/gcf/provisioner.go:1401-1408 | internal/dispatch/gcf/provisioner.go:1410-1417 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/cli/gitlab_profile.go:640 — internal/cli/gitlab_profile.go:640-647 | internal/config/config.go:433-440 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) REDACTED:1145 — REDACTED:1145-1152 | internal/forge/gitlab/gitlab.go:417-424 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/cli/dispatch_route.go:122 — internal/cli/dispatch_route.go:122-129 | internal/harness/forge.go:58-65 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/poll/webhook.go:606 — internal/poll/webhook.go:606-613 | internal/runtime/pi_progress.go:187-194 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/binary/download.go:225 — internal/binary/download.go:225-232 | pkg/behaviourtest/steps/cleanup.go:438-445 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/behaviourfail/behaviourfail.go:139 — internal/behaviourfail/behaviourfail.go:139-146 | internal/cli/run_openai.go:177-184 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/jirapoll/poller.go:78 — internal/jirapoll/poller.go:78-85 | internal/mintcore/bot_role.go:47-56 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×12
  • Edited copy of a member (7 corresponding lines) internal/forge/gitlab/deploy_keys.go:107 — internal/forge/gitlab/deploy_keys.go:107-116 | internal/forge/gitlab/service_accounts.go:30-36 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/forge/jira/client.go:832 — internal/forge/jira/client.go:832-838 | internal/forge/jira/client.go:929-936 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/dispatch/cf/provisioner.go:172 — internal/dispatch/cf/provisioner.go:172-178 | internal/dispatch/gcf/provisioner.go:186-192 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/behaviourtest/drivers/scm/parse.go:9 — pkg/behaviourtest/drivers/scm/parse.go:9-15 | internal/cli/resolvemrsource.go:67-73 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/forge/gitlab/hooks.go:100 — internal/forge/gitlab/hooks.go:100-106 | internal/forge/gitlab/service_accounts.go:158-164 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/behaviourtest/steps/bot_role_probe.go:514 — pkg/behaviourtest/steps/bot_role_probe.go:514-520 | pkg/behaviourtest/steps/mint_probe.go:807-813 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/repos/gitlab_poller_retirement.go:265 — internal/repos/gitlab_poller_retirement.go:265-271 | pkg/behaviourtest/drivers/install/mint_groups.go:101-107 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/harnessdispatch/enumerate.go:137 — internal/harnessdispatch/enumerate.go:137-143 | internal/harnessdispatch/killswitch.go:6-12 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/cli/admin.go:1263 — internal/cli/admin.go:1263-1271 | internal/mintcore/github.go:999-1005 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/agentnew/spec.go:36 — internal/agentnew/spec.go:36-42 | REDACTED:524-530 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/cli/admin.go:159 — internal/cli/admin.go:159-165 | internal/e2etest/auth.go:70-76 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/cli/run.go:367 — internal/cli/run.go:367-373 | internal/cli/run_overrides.go:146-152 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D30 · Dependency Vulnerabilities · Medium CVE · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×11
  • Duplicated block (7 lines × 3) internal/harness/compose.go:1140 — internal/harness/compose.go:1140-1146 | internal/harness/compose.go:1199-1205 | internal/harness/compose.go:1263-1269 — 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 `internal/harness/compose.go:1140` 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 × 3) internal/repos/gitlab_trigger_job_templates.go:293 — internal/repos/gitlab_trigger_job_templates.go:293-299 | internal/repos/gitlab_webhook.go:1643-1649 | internal/repos/gitlab_webhook.go:1695-1701 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:1376 — internal/dispatch/gcf/gcp.go:1376-1384 | internal/dispatch/gcf/gcp.go:1433-1439 | internal/dispatch/gcf/gcp.go:1476-1482 — 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 `internal/dispatch/gcf/gcp.go:1376` 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 × 3) internal/cli/agent.go:694 — internal/cli/agent.go:694-700 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:591-598 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:924-931 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/agent.go:694` 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. Check import visibility before settling on that home: `internal/cli/agent.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:507 — internal/dispatch/gcf/gcp.go:507-513 | internal/dispatch/gcf/gcp.go:603-609 | internal/dispatch/gcf/gcp.go:829-835 — 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 `internal/dispatch/gcf/gcp.go:507` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:1426 — internal/dispatch/gcf/gcp.go:1426-1432 | internal/dispatch/gcf/gcp.go:1469-1475 | internal/dispatch/gcf/gcp.go:1570-1576 — 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 `internal/dispatch/gcf/gcp.go:1426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:547 — internal/dispatch/gcf/gcp.go:547-553 | internal/dispatch/gcf/gcp.go:661-667 | internal/dispatch/gcf/gcp.go:715-721 — 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 `internal/dispatch/gcf/gcp.go:547` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:1512 — internal/dispatch/gcf/gcp.go:1512-1518 | internal/dispatch/gcf/gcp.go:1586-1592 | internal/dispatch/gcf/gcp.go:2165-2171 — 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 `internal/dispatch/gcf/gcp.go:1512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) internal/dispatch/gcf/gcp.go:437 — internal/dispatch/gcf/gcp.go:437-443 | internal/dispatch/gcf/gcp.go:620-626 | internal/dispatch/gcf/gcp.go:1212-1218 — 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 `internal/dispatch/gcf/gcp.go:437` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) pkg/behaviourtest/steps/dispatch.go:249 — pkg/behaviourtest/steps/dispatch.go:249-255 | pkg/behaviourtest/steps/dispatch.go:323-329 | pkg/behaviourtest/steps/url_dispatch.go:71-77 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/dispatch.go:249` 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 (7 lines × 3) pkg/behaviourtest/steps/dispatch.go:80 — pkg/behaviourtest/steps/dispatch.go:80-86 | pkg/behaviourtest/steps/dispatch.go:108-114 | pkg/behaviourtest/steps/gateway.go:224-230 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/dispatch.go:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×10
  • Edited copy of a member (9 corresponding lines) internal/forge/jira/client.go:805 — internal/forge/jira/client.go:805-813 | internal/forge/jira/client.go:904-912 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/statuscomment/statuscomment.go:300 — internal/statuscomment/statuscomment.go:300-308 | internal/statuscomment/statuscomment.go:314-322 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/dispatch/gcf/gcp.go:955 — internal/dispatch/gcf/gcp.go:955-964 | internal/gcp/client.go:208-216 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/normentity/id.go:27 — internal/normentity/id.go:27-36 | internal/actorcache/actorcache.go:60-68 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/tracker/forge_client.go:105 — internal/tracker/forge_client.go:105-116 | internal/tracker/jira_client.go:240-248 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/cli/agent.go:972 — internal/cli/agent.go:972-980 | internal/config/managed_safety.go:312-320 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/forge/gitlab/gitlab.go:263 — internal/forge/gitlab/gitlab.go:263-271 | internal/forge/jira/client.go:469-477 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/poll/convert.go:371 — internal/poll/convert.go:371-379 | internal/repos/gitlab_roles_rotate.go:1994-2002 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/evalmeasure/types.go:164 — internal/evalmeasure/types.go:164-172 | internal/repos/gitlab_roles_rotate.go:1951-1959 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/runtime/claude_progress.go:709 — internal/runtime/claude_progress.go:709-718 | internal/runtime/opencode_progress.go:11-19 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) internal/actorcache/actorcache.go:99 — internal/actorcache/actorcache.go:99-113 | internal/normentity/id.go:67-81 — before extracting anything, compare `internal/actorcache/actorcache.go` and `internal/normentity/id.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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. 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 (15 lines × 2) internal/cli/mint.go:2153 — internal/cli/mint.go:2153-2167 | internal/cli/mint.go:2235-2249 — both copies are in the same file, so extract the 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 `internal/cli/mint.go:2153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/config/managed.go:268 — internal/config/managed.go:268-282 | internal/repos/manifest_set.go:854-868 — 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 (15 lines × 2) internal/scaffold/vendorcontent.go:87 — internal/scaffold/vendorcontent.go:87-101 | internal/scaffold/vendorcontent.go:121-135 — both copies are in the same file, so extract the 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 `internal/scaffold/vendorcontent.go:87` 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/behaviourtest/drivers/ci/githubactions/githubactions.go:203 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:203-217 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:857-871 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (15 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:404 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:404-418 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:288-302 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (15 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1255 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1255-1269 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:444-458 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) pkg/behaviourtest/steps/dispatch.go:139 — pkg/behaviourtest/steps/dispatch.go:139-153 | pkg/behaviourtest/steps/dispatch.go:173-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) internal/poll/state.go:1117 — internal/poll/state.go:1117-1133 | internal/poll/state.go:1261-1275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/poll/state.go:1117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/security/hooks/ssrf_pretool.py:655 — internal/security/hooks/ssrf_pretool.py:655-669 | internal/security/hooks/ssrf_pretool.py:851-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×10
  • Duplicated block (14 lines × 2) internal/cli/reconcilestatus.go:227 — internal/cli/reconcilestatus.go:227-240 | internal/cli/run.go:7174-7187 — 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 `internal/cli/reconcilestatus.go:227` 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 (14 lines × 2) REDACTED:1498 — REDACTED:1498-1511 | REDACTED:1538-1551 — both copies are in the same file, so extract the 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:1498` 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 (14 lines × 2) internal/forge/gitlab/gitlab.go:290 — internal/forge/gitlab/gitlab.go:290-303 | internal/forge/jira/client.go:501-514 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/forge/gitlab/issue.go:444 — internal/forge/gitlab/issue.go:444-457 | internal/forge/gitlab/issue.go:474-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/forge/gitlab/issue.go:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/harnessdispatch/input/ghaevent.go:150 — internal/harnessdispatch/input/ghaevent.go:150-163 | internal/harnessdispatch/input/ghaevent.go:247-260 — both copies are in the same file, so extract the 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 `internal/harnessdispatch/input/ghaevent.go:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/repos/gitlabci.go:1368 — internal/repos/gitlabci.go:1368-1381 | internal/repos/gitlabci.go:1387-1400 — both copies are in the same file, so extract the 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 `internal/repos/gitlabci.go:1368` 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 (14 lines × 2) internal/runtime/claude.go:505 — internal/runtime/claude.go:505-518 | internal/runtime/pi_run.go:1071-1084 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) internal/runtime/codex_progress.go:743 — internal/runtime/codex_progress.go:743-756 | internal/runtime/pi_transcript.go:201-214 — 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 `internal/runtime/codex_progress.go:743` 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 (14 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:292 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:292-305 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:310-323 — both copies are in the same file, so extract the 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/behaviourtest/drivers/ci/githubactions/githubactions.go:292` 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 (14 lines × 2) internal/dispatch/gcf/gcp.go:1844 — internal/dispatch/gcf/gcp.go:1844-1857 | internal/dispatch/gcf/gcp.go:2079-2092 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:1844` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×9
  • Edited copy of a member (21 corresponding lines) internal/repos/converge.go:461 — internal/repos/converge.go:461-481 | internal/repos/converge.go:2189-2209 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) REDACTED:2247 — REDACTED:2247-2267 | REDACTED:2326-2346 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/cli/reconcilestatus.go:217 — internal/cli/reconcilestatus.go:217-242 | internal/cli/run.go:7169-7189 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/cli/issues.go:981 — internal/cli/issues.go:981-1005 | internal/sticky/sticky.go:172-192 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/behaviourtest/steps/fork.go:96 — pkg/behaviourtest/steps/fork.go:96-116 | pkg/behaviourtest/steps/fork.go:126-148 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:739 — pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:739-759 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:788-814 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/poll/state.go:1480 — internal/poll/state.go:1480-1500 | internal/poll/state.go:1521-1545 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) REDACTED:1258 — REDACTED:1258-1279 | REDACTED:1281-1301 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) REDACTED:1666 — REDACTED:1666-1686 | REDACTED:1702-1724 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×8
  • Edited copy of a member (15 corresponding lines) internal/runtime/codex_bootstrap.go:487 — internal/runtime/codex_bootstrap.go:487-511 | internal/runtime/pi_bootstrap.go:951-965 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) REDACTED:916 — REDACTED:916-930 | REDACTED:932-949 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:694 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:694-708 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:720-737 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/behaviourtest/steps/reaction.go:83 — pkg/behaviourtest/steps/reaction.go:83-101 | pkg/behaviourtest/steps/reaction.go:103-117 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/repos/gitlab_trigger_account.go:1220 — internal/repos/gitlab_trigger_account.go:1220-1236 | internal/repos/gitlab_trigger_account.go:1616-1630 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/behaviourtest/steps/gateway.go:203 — pkg/behaviourtest/steps/gateway.go:203-217 | pkg/behaviourtest/steps/runner_secrets.go:78-92 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/cli/agent.go:94 — internal/cli/agent.go:94-108 | internal/cli/agent.go:148-162 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/sandbox/sandbox.go:1092 — internal/sandbox/sandbox.go:1092-1113 | internal/sandbox/sandbox.go:1118-1132 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×8
  • Duplicated block (18 lines × 2) internal/cli/agent.go:513 — internal/cli/agent.go:513-530 | internal/cli/agent.go:722-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) internal/cli/repos_gitlab.go:536 — internal/cli/repos_gitlab.go:536-553 | internal/cli/repos_gitlab.go:579-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) internal/mintcore/handler.go:714 — internal/mintcore/handler.go:714-731 | internal/mintcore/handler.go:816-833 — both copies are in the same file, so extract the 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 `internal/mintcore/handler.go:714` 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 (18 lines × 2) internal/preset/preset.go:132 — internal/preset/preset.go:132-149 | REDACTED:580-597 — 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 `internal/preset/preset.go:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) pkg/behaviourtest/steps/playback.go:281 — pkg/behaviourtest/steps/playback.go:281-298 | pkg/behaviourtest/steps/playback.go:852-869 — both copies are in the same file, so extract the 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/behaviourtest/steps/playback.go:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) internal/mintcore/handler.go:693 — internal/mintcore/handler.go:693-710 | internal/mintcore/handler.go:795-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) internal/harness/compose.go:1176 — internal/harness/compose.go:1176-1193 | internal/harness/compose.go:1240-1257 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1176` 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 (18 lines × 2) internal/harness/forge.go:98 — internal/harness/forge.go:98-115 | internal/harness/forge.go:179-196 — both copies are in the same file, so extract the 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 `internal/harness/forge.go:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×7
  • Edited copy of a member (26 corresponding lines) internal/cli/bootstrap_scan.go:200 — internal/cli/bootstrap_scan.go:200-225 | internal/cli/bootstrap_scan.go:227-257 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) internal/repos/gitlab_trigger_schedules.go:172 — internal/repos/gitlab_trigger_schedules.go:172-197 | internal/repos/gitlab_trigger_schedules.go:312-345 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) REDACTED:2853 — REDACTED:2853-2878 | REDACTED:2884-2909 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) internal/scaffold/vendorcontent.go:86 — internal/scaffold/vendorcontent.go:86-111 | internal/scaffold/vendorcontent.go:113-148 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) REDACTED:3212 — REDACTED:3212-3237 | REDACTED:3314-3339 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:325 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:325-354 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:249-274 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/behaviourtest/steps/fork.go:280 — pkg/behaviourtest/steps/fork.go:280-306 | pkg/behaviourtest/steps/fork.go:332-357 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×7
  • Edited copy of a member (22 corresponding lines) pkg/behaviourtest/steps/dispatch.go:596 — pkg/behaviourtest/steps/dispatch.go:596-617 | pkg/behaviourtest/steps/fork.go:380-413 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/cli/run.go:8443 — internal/cli/run.go:8443-8464 | internal/harness/registry.go:84-107 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/poll/state.go:624 — internal/poll/state.go:624-647 | internal/poll/state.go:1421-1442 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/cli/run.go:7197 — internal/cli/run.go:7197-7222 | internal/cli/run.go:7229-7250 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/artifacts/telemetry.go:212 — internal/artifacts/telemetry.go:212-233 | internal/artifacts/telemetry.go:236-257 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/fetch/fetch.go:336 — internal/fetch/fetch.go:336-357 | internal/gcp/client.go:229-254 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/evalmeasure/types.go:98 — internal/evalmeasure/types.go:98-119 | internal/evalmeasure/types.go:122-143 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×7
  • Edited copy of a member (19 corresponding lines) internal/repos/gitlab_poller_generation.go:647 — internal/repos/gitlab_poller_generation.go:647-665 | internal/repos/gitlab_webhook_poller.go:746-767 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/runtime/dummy.go:223 — internal/runtime/dummy.go:223-247 | REDACTED:88-106 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:23 — REDACTED:23-41 | REDACTED:112-131 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:1851 — REDACTED:1851-1869 | REDACTED:1872-1890 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/cli/run.go:8801 — internal/cli/run.go:8801-8830 | internal/sandbox/sandbox.go:2670-2688 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:846 — REDACTED:846-867 | REDACTED:1414-1432 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/repos/gitlab_pipeline_access.go:376 — internal/repos/gitlab_pipeline_access.go:376-394 | internal/repos/gitlab_pipeline_access.go:400-420 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) internal/runtime/codex_bootstrap.go:661 — internal/runtime/codex_bootstrap.go:661-679 | internal/runtime/pi_bootstrap.go:1005-1021 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) internal/repos/status.go:564 — internal/repos/status.go:564-584 | internal/repos/status.go:588-604 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) internal/forge/gitlab/poll.go:37 — internal/forge/gitlab/poll.go:37-56 | REDACTED:345-361 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:378 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:378-401 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:306-322 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:2271 — REDACTED:2271-2287 | REDACTED:2697-2718 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:1892 — REDACTED:1892-1913 | REDACTED:1915-1931 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) internal/cli/issues.go:883 — internal/cli/issues.go:883-904 | internal/cli/issues.go:924-940 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) pkg/behaviourtest/report.go:293 — pkg/behaviourtest/report.go:293-314 | pkg/behaviourtest/steps/debuglogs.go:1019-1036 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) REDACTED:2610 — REDACTED:2610-2632 | REDACTED:2636-2653 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/harness/compose.go:2571 — internal/harness/compose.go:2571-2588 | internal/harness/compose.go:2595-2612 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/poll/state.go:1688 — internal/poll/state.go:1688-1705 | internal/poll/state.go:1709-1729 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/behaviourtest/steps/dispatch.go:407 — pkg/behaviourtest/steps/dispatch.go:407-424 | pkg/behaviourtest/steps/dispatch_count.go:19-36 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/repos/gitlab_pipeline_access.go:187 — internal/repos/gitlab_pipeline_access.go:187-204 | internal/repos/gitlab_poller_retirement.go:338-355 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/config/config.go:951 — internal/config/config.go:951-1021 | internal/config/config.go:1130-1147 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×7
  • Edited copy of a member (20 corresponding lines) pkg/behaviourtest/steps/url_dispatch.go:94 — pkg/behaviourtest/steps/url_dispatch.go:94-113 | pkg/behaviourtest/steps/url_dispatch.go:123-142 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/cli/run.go:6868 — internal/cli/run.go:6868-6887 | internal/evalmeasure/find.go:136-157 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/forge/gitlab/ci.go:821 — internal/forge/gitlab/ci.go:821-840 | internal/forge/gitlab/ci.go:891-913 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:1238 — REDACTED:1238-1257 | REDACTED:1261-1283 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/runtime/codex_progress.go:737 — internal/runtime/codex_progress.go:737-756 | internal/runtime/pi_transcript.go:192-216 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/cli/github.go:858 — internal/cli/github.go:858-881 | internal/repos/config_preset.go:72-91 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:1377 — REDACTED:1377-1396 | internal/urlutil/urlutil.go:61-80 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×7
  • Duplicated block (9 lines × 3) internal/mintclient/mintclient.go:224 — internal/mintclient/mintclient.go:224-232 | internal/mintclient/mintclient.go:307-315 | internal/mintclient/mintclient.go:609-617 — 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 `internal/mintclient/mintclient.go:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 3) internal/runtime/codex_transcript.go:282 — internal/runtime/codex_transcript.go:282-290 | internal/runtime/opencode_transcript.go:76-84 | internal/runtime/pi_transcript.go:160-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/codex_transcript.go:282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) pkg/behaviourtest/steps/base_dispatch.go:38 — pkg/behaviourtest/steps/base_dispatch.go:38-46 | pkg/behaviourtest/steps/base_dispatch.go:183-191 | pkg/behaviourtest/steps/base_dispatch.go:270-278 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/behaviourtest/steps/base_dispatch.go:280` calls `Errorf` and `pkg/behaviourtest/steps/base_dispatch.go:193` 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 (9 lines × 3) internal/forge/gitlab/ci.go:1162 — internal/forge/gitlab/ci.go:1162-1171 | internal/forge/gitlab/ci.go:1198-1207 | internal/forge/gitlab/ci.go:1256-1264 — 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 `internal/forge/gitlab/ci.go:1162` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `ref` in one and `jobToken` 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.
  • Duplicated block (9 lines × 3) internal/dispatch/gcf/gcp.go:670 — internal/dispatch/gcf/gcp.go:670-678 | internal/dispatch/gcf/gcp.go:724-732 | internal/dispatch/gcf/gcp.go:1185-1194 — 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 `internal/dispatch/gcf/gcp.go:670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/dispatch/gcf/gcp.go:276 — internal/dispatch/gcf/gcp.go:276-284 | internal/dispatch/gcf/gcp.go:324-332 | internal/dispatch/gcf/gcp.go:573-581 — 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 `internal/dispatch/gcf/gcp.go:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 3) internal/e2etest/cleanup.go:222 — internal/e2etest/cleanup.go:222-230 | internal/e2etest/cleanup.go:253-261 | internal/e2etest/cleanup.go:285-293 — 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 `internal/e2etest/cleanup.go:222` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · TooManyFields · ×6
  • TooManyFields: FakeClient REDACTED:214 — TooManyFields — 138 stored fields beside 142 methods. The bar is 30 stored fields; this is 108 over it, 4.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: World pkg/behaviourtest/world/world.go:21 — TooManyFields — 82 stored fields beside 3 methods. The bar is 30 stored fields; this is 52 over it, 2.73× 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: Harness REDACTED:377 — TooManyFields — 38 stored fields beside 35 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TaskProgressEvent internal/runtime/event.go:204 — TooManyFields — 35 stored fields beside 1 method. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: reposInstallConfig internal/cli/repos.go:364 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: InstallConfig internal/repos/install.go:35 — TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×6
  • Edited copy of a member (25 corresponding lines) REDACTED:134 — REDACTED:134-168 | internal/resolve/resolve.go:100-124 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) internal/gitlabroles/readiness.go:63 — internal/gitlabroles/readiness.go:63-90 | internal/gitlabroles/readiness.go:311-335 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/behaviourtest/steps/playback.go:279 — pkg/behaviourtest/steps/playback.go:279-303 | pkg/behaviourtest/steps/playback.go:851-880 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/behaviourtest/steps/dispatch.go:138 — pkg/behaviourtest/steps/dispatch.go:138-164 | pkg/behaviourtest/steps/owners.go:117-141 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) REDACTED:3040 — REDACTED:3040-3064 | REDACTED:3066-3090 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) internal/dispatch/cf/cloudflare_api.go:229 — internal/dispatch/cf/cloudflare_api.go:229-253 | internal/dispatch/cf/cloudflare_api.go:284-308 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • Duplicated block (10 lines × 3) internal/cli/inference.go:145 — internal/cli/inference.go:145-154 | internal/cli/inference.go:364-373 | internal/cli/inference.go:620-629 — 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 `internal/cli/inference.go:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) REDACTED:751 — REDACTED:751-761 | REDACTED:774-784 | REDACTED:832-841 — 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 (10 lines × 3) internal/harness/compose.go:795 — internal/harness/compose.go:795-804 | internal/resolve/resolve.go:641-650 | internal/resolve/resolve.go:774-783 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/harness/compose.go:795` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) internal/harness/compose.go:1469 — internal/harness/compose.go:1469-1478 | internal/harness/compose.go:1491-1500 | internal/harness/compose.go:1513-1522 — 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 `internal/harness/compose.go:1469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) internal/harness/compose.go:1658 — internal/harness/compose.go:1658-1667 | internal/harness/compose.go:1680-1689 | internal/harness/compose.go:1703-1712 — 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 `internal/harness/compose.go:1658` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) internal/runtime/claude.go:534 — internal/runtime/claude.go:534-543 | internal/runtime/codex_run.go:649-658 | internal/runtime/pi_run.go:1102-1111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/claude.go:534` 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.
D17 · Explicit Debt · TodoComment · ×5
  • TodoComment pkg/behaviourtest/select.go:69 — // TODO: client is a GitHub forge.Client (from e2etest.NewLiveClient). — 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/behaviourtest/select.go:84 — // TODO: client is a GitHub forge.Client (from e2etest.NewLiveClient). — 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 internal/cli/run.go:2414 — // last-value-wins so this append takes precedence. TODO(fullsend-ai/agents#191):
  • TodoComment internal/cli/run.go:4409 — // TODO(#345): remove this once admin install preserves the executable
  • TodoComment internal/cli/run.go:7673 — // TODO(ADR-0045 R22): use forge platform context instead of raw env check.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/cli/agent.go:214 — internal/cli/agent.go:214-320 | internal/cli/agent.go:390-450 | internal/cli/agent.go:512-598 | internal/cli/agent.go:721-808 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/dispatch/gcf/provisioner.go:358 — internal/dispatch/gcf/provisioner.go:358-393 | internal/dispatch/gcf/provisioner.go:396-411 | internal/dispatch/gcf/provisioner.go:415-454 | internal/dispatch/gcf/provisioner.go:458-494 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/runtime/claude.go:485 — internal/runtime/claude.go:485-549 | internal/runtime/codex_run.go:519-754 | internal/runtime/opencode_run.go:426-551 | internal/runtime/pi_run.go:1056-1142 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1281 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1281-1377 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1660-1716 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:468-518 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:680-735 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/security/hooks/canary_posttool.py:52 — internal/security/hooks/canary_posttool.py:52-68 | internal/security/hooks/canary_pretool.py:43-59 | internal/security/hooks/context_suppress_posttool.py:108-125 | internal/security/hooks/tool_allowlist_pretool.py:36-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×5
  • Edited copy of a member (42 corresponding lines) internal/mintcore/handler.go:690 — internal/mintcore/handler.go:690-731 | internal/mintcore/handler.go:792-833 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) internal/dispatch/gcf/provisioner.go:1706 — internal/dispatch/gcf/provisioner.go:1706-1747 | internal/dispatch/gcf/provisioner.go:1792-1833 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) internal/dispatch/gcf/gcp.go:1816 — internal/dispatch/gcf/gcp.go:1816-1857 | internal/dispatch/gcf/gcp.go:2051-2092 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) internal/repos/gitlab_trigger_consumer.go:246 — internal/repos/gitlab_trigger_consumer.go:246-287 | internal/repos/gitlab_webhook.go:1373-1415 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) internal/repos/gitlabci.go:800 — internal/repos/gitlabci.go:800-849 | internal/repos/gitlabci.go:1025-1066 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×5
  • Edited copy of a member (31 corresponding lines) internal/security/hooks/canary_posttool.py:72 — internal/security/hooks/canary_posttool.py:72-113 | internal/security/hooks/canary_pretool.py:63-93 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/behaviourtest/drivers/install/ensure.go:572 — pkg/behaviourtest/drivers/install/ensure.go:572-602 | pkg/behaviourtest/drivers/install/ensure.go:614-651 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) REDACTED:4838 — REDACTED:4838-4868 | REDACTED:4929-4967 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) internal/poll/legacy_mirror.go:152 — internal/poll/legacy_mirror.go:152-182 | internal/poll/state.go:220-250 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) REDACTED:3518 — REDACTED:3518-3555 | REDACTED:3558-3588 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) internal/forge/gitlab/deploy_keys.go:75 — internal/forge/gitlab/deploy_keys.go:75-102 | internal/forge/gitlab/service_accounts.go:285-311 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) REDACTED:3938 — REDACTED:3938-3964 | REDACTED:3967-3997 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/forge/gitlab/ci.go:1449 — internal/forge/gitlab/ci.go:1449-1475 | internal/forge/gitlab/ci.go:1980-2007 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/forge/gitlab/ci.go:1138 — internal/forge/gitlab/ci.go:1138-1171 | internal/forge/gitlab/ci.go:1181-1207 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/security/hooks/ssrf_pretool.py:643 — internal/security/hooks/ssrf_pretool.py:643-669 | internal/security/hooks/ssrf_pretool.py:673-707 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×5
  • Edited copy of a member (23 corresponding lines) internal/forge/jira/client.go:722 — internal/forge/jira/client.go:722-744 | internal/forge/jira/client.go:878-900 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) internal/dispatch/gcf/gcp.go:882 — internal/dispatch/gcf/gcp.go:882-905 | internal/dispatch/gcf/gcp.go:972-994 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) internal/jirapoll/convert.go:233 — internal/jirapoll/convert.go:233-257 | internal/poll/convert.go:266-288 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) internal/security/redactor.go:204 — internal/security/redactor.go:204-245 | internal/security/redactor.go:247-269 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) internal/sandbox/sandbox.go:1136 — internal/sandbox/sandbox.go:1136-1158 | internal/sandbox/sandbox.go:1165-1194 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) internal/actorcache/actorcache.go:73 — internal/actorcache/actorcache.go:73-91 | internal/normentity/id.go:41-59 — before extracting anything, compare `internal/actorcache/actorcache.go` and `internal/normentity/id.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
  • Duplicated block (19 lines × 2) internal/dispatch/gcf/provisioner.go:997 — internal/dispatch/gcf/provisioner.go:997-1015 | internal/dispatch/gcf/provisioner.go:1052-1070 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) internal/mintcore/handler.go:734 — internal/mintcore/handler.go:734-752 | internal/mintcore/handler.go:838-856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (19 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1388 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1388-1406 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:529-547 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (19 lines × 2) internal/harness/compose.go:1672 — internal/harness/compose.go:1672-1690 | internal/harness/compose.go:1695-1713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/harness/compose.go:1672` 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×4
  • Fixed-sleep synchronisation: run: an abort while the child is running terminates it internal/runtime/pi_extension/fullsend-agent.test.mjs:1127 — This test starts work it did not wait for (`p`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 30))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: run: a timeout during an oversized agent_end is still a timeout internal/runtime/pi_extension/fullsend-agent.test.mjs:1345 — This test starts work it did not wait for (`p`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 10))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: MCP child dispatch intersects concrete tools and rechecks declared extension trees internal/runtime/pi_extension/fullsend-agent.test.mjs:1390 — This test starts work it did not wait for (`tool`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 5))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: run: a fallback gets the time left of the dispatch, not a fresh timeout internal/runtime/pi_extension/fullsend-agent.test.mjs:2189 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 1600))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×4
  • Edited copy of a member (39 corresponding lines) internal/runtime/claude.go:561 — internal/runtime/claude.go:561-611 | internal/runtime/opencode_transcript.go:24-62 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) internal/harnessdispatch/input/ghaevent.go:132 — internal/harnessdispatch/input/ghaevent.go:132-170 | internal/harnessdispatch/input/ghaevent.go:220-267 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) internal/repos/remote_scaffold.go:70 — internal/repos/remote_scaffold.go:70-109 | internal/scaffold/installfiles.go:37-75 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) internal/cli/inference_gateway.go:88 — internal/cli/inference_gateway.go:88-129 | internal/cli/inference_openai.go:806-844 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) internal/dispatch/gcf/gcp.go:788 — internal/dispatch/gcf/gcp.go:788-814 | internal/dispatch/gcf/gcp.go:817-840 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/behaviourtest/steps/playback.go:489 — pkg/behaviourtest/steps/playback.go:489-516 | pkg/behaviourtest/steps/playback.go:545-568 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) internal/actorcache/actorcache.go:71 — internal/actorcache/actorcache.go:71-94 | internal/normentity/id.go:39-62 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) internal/artifacts/measurements.go:31 — internal/artifacts/measurements.go:31-54 | internal/artifacts/telemetry.go:55-81 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) internal/cli/github.go:859 — internal/cli/github.go:859-875 | internal/repos/config_preset.go:73-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) REDACTED:748 — REDACTED:748-764 | REDACTED:771-787 — both copies are in the same file, so extract the 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:748` 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) internal/jirapoll/convert.go:234 — internal/jirapoll/convert.go:234-250 | internal/poll/convert.go:267-283 — 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 (17 lines × 2) internal/harness/compose.go:1485 — internal/harness/compose.go:1485-1501 | internal/harness/compose.go:1507-1523 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1485` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) internal/cli/issues.go:126 — internal/cli/issues.go:126-131 | internal/cli/issues.go:452-457 | internal/cli/issues_transition.go:55-59 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/issues.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/cli/repos_gitlab.go:476 — internal/cli/repos_gitlab.go:476-481 | internal/cli/repos_gitlab_service_accounts.go:311-315 | internal/gitlablifecycle/trigger_account.go:78-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/repos_gitlab.go:476` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 3) internal/dispatch/gcf/provisioner.go:1739 — internal/dispatch/gcf/provisioner.go:1739-1743 | internal/dispatch/gcf/provisioner.go:1781-1785 | internal/dispatch/gcf/provisioner.go:1825-1829 — 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 `internal/dispatch/gcf/provisioner.go:1739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) internal/harness/compose.go:2105 — internal/harness/compose.go:2105-2109 | internal/harness/compose.go:2283-2287 | internal/harness/compose.go:2492-2496 — 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 `internal/harness/compose.go:2105` 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.
X3 · Exception handling · Lost error (reports an error that is nil on this path) · ×4
  • Lost error (reports an error that is nil on this path) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:478 — `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here.
  • Lost error (reports an error that is nil on this path) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:690 — `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here.
  • Lost error (reports an error that is nil on this path) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1290 — `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here.
  • Lost error (reports an error that is nil on this path) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1669 — `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) pkg/behaviourtest/steps/runtime.go:467 — pkg/behaviourtest/steps/runtime.go:467-502 | pkg/behaviourtest/steps/runtime.go:514-553 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) REDACTED:1229 — REDACTED:1229-1264 | REDACTED:1268-1303 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) internal/cli/run.go:7293 — internal/cli/run.go:7293-7331 | internal/cli/tirith_repo_policy.go:65-100 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) internal/dispatch/gcf/gcp.go:257 — internal/dispatch/gcf/gcp.go:257-288 | internal/dispatch/gcf/gcp.go:313-340 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) internal/runtime/codex_bootstrap.go:516 — internal/runtime/codex_bootstrap.go:516-543 | internal/runtime/codex_bootstrap.go:626-654 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) internal/scaffold/vendormanifest.go:172 — internal/scaffold/vendormanifest.go:172-199 | internal/scaffold/vendormanifest.go:204-244 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×3
  • Edited copy of a member (6 corresponding lines) internal/cli/run_jira.go:662 — internal/cli/run_jira.go:662-667 | internal/cli/run_openai.go:318-325 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) internal/repos/gitlab_account_deletion_safety.go:12 — internal/repos/gitlab_account_deletion_safety.go:12-17 | internal/repos/gitlab_poller_credential_policy.go:14-20 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) internal/appsetup/appsetup.go:669 — internal/appsetup/appsetup.go:669-674 | internal/repos/gitlab_webhook.go:2658-2663 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/repos/gitlabci.go:1068 — internal/repos/gitlabci.go:1068-1081 | internal/repos/gitlabci.go:2016-2027 | internal/repos/manifest_set.go:1226-1237 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/cli/run.go:6175 — internal/cli/run.go:6175-6186 | internal/prescript/prescript.go:307-323 | internal/runtime/codex_run.go:68-79 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/envmanifest/manifest.go:81 — internal/envmanifest/manifest.go:81-93 | internal/repos/converge.go:2023-2037 | internal/repos/gitlab_roles_rotate.go:2004-2015 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×3
  • Edited copy of a member (5 corresponding lines) internal/config/legacy_tracking.go:301 — internal/config/legacy_tracking.go:301-305 | internal/repos/gitlabci.go:1360-1364 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) internal/runtime/pi_edit_repair.go:54 — internal/runtime/pi_edit_repair.go:54-58 | internal/runtime/pi_run.go:963-970 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) internal/cli/dispatch_botrole.go:67 — internal/cli/dispatch_botrole.go:67-72 | internal/harnessdispatch/auth.go:116-120 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) internal/dispatch/gcf/provisioner.go:1021 — internal/dispatch/gcf/provisioner.go:1021-1031 | internal/dispatch/gcf/provisioner.go:1076-1087 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/provisioner.go:1076` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–12 lines × 2) internal/runtime/claude.go:534 — internal/runtime/claude.go:534-545 | internal/runtime/pi_run.go:1102-1112 — 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 `internal/runtime/claude.go:534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) internal/harness/compose.go:303 — internal/harness/compose.go:303-313 | internal/harness/compose.go:439-450 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) internal/cli/mint.go:773 — internal/cli/mint.go:773-783 | internal/cli/mint.go:2288-2298 | internal/cli/mint_delete.go:119-129 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/cli/mint.go:2299` calls `Context` and `internal/cli/mint.go:785` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) internal/harness/compose.go:1563 — internal/harness/compose.go:1563-1573 | internal/harness/compose.go:1583-1593 | internal/harness/compose.go:1606-1616 — 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 `internal/harness/compose.go:1563` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) internal/repos/gitlab_trigger_jobs.go:730 — internal/repos/gitlab_trigger_jobs.go:730-740 | internal/repos/gitlab_webhook.go:1374-1384 | internal/repos/gitlab_webhook.go:1536-1546 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) internal/cli/lock.go:728 — internal/cli/lock.go:728-736 | internal/cli/run.go:7943-7950 — 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 `internal/cli/lock.go:728` 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–9 lines × 2) internal/dispatch/gcf/gcp.go:1249 — internal/dispatch/gcf/gcp.go:1249-1256 | internal/dispatch/gcf/gcp.go:1507-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8–9 lines × 2) internal/mintcore/jwks_verifier.go:111 — internal/mintcore/jwks_verifier.go:111-118 | internal/mintcore/sts_verifier.go:96-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×3
  • Index access outside its own emptiness guard internal/repos/gitlab_webhook_trigger_account.go:239 — `m` holds what `FindStringSubmatch` returns, and `m[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(m)` (or nil) first, as the other call site does.
  • Index access outside its own emptiness guard REDACTED:1137 — `parts` holds what `SplitN` returns, and `parts[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(parts)` (or nil) first, as the other call site does.
  • Index access outside its own emptiness guard internal/cli/content_collector.go:866 — `urlSep.FindStringIndex(run)[1]` takes element 1 of what `FindStringIndex` returns without checking its length, and this file tests that same result elsewhere before indexing it — the result can be nil or shorter. Here a short result panics with `index out of range`. Assign it and test `len` (or nil) first, as the other call site does.
X3 · Exception handling · Discarded error (assigned to `_`, then its result used) · ×3
  • Discarded error (assigned to `_`, then its result used) pkg/behaviourtest/steps/debuglogs.go:787 — `created, _ := time.Parse(time.RFC3339, issue.CreatedAt)` writes the call's error to `_` and then uses `created` as if the call succeeded. When `time.Parse` fails, `created` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `created` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) pkg/behaviourtest/steps/runner_secrets.go:152 — `retry, _ := checkHarnessRunLogs(run, agent, needle, logs, fetchErr)` writes the call's error to `_` and then uses `retry` as if the call succeeded. When `checkHarnessRunLogs` fails, `retry` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `retry` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) REDACTED:77 — `data, _ := json.Marshal(payload)` writes the call's error to `_` and then uses `data` as if the call succeeded. When `json.Marshal` fails, `data` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `data` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D2 · Cognitive Complexity · LiveClient.ListOrgRepos (cognitive 17) · ×2
  • LiveClient.ListOrgRepos (cognitive 17) REDACTED:1173 — LiveClient.ListOrgRepos has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 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.
  • LiveClient.ListOrgRepos (cognitive 17) REDACTED:157 — LiveClient.ListOrgRepos has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.AssertNoWorkflow (cognitive 16) · ×2
  • Driver.AssertNoWorkflow (cognitive 16) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:325 — Driver.AssertNoWorkflow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Driver.AssertNoWorkflow (cognitive 16) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:249 — Driver.AssertNoWorkflow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×2
  • Edited copy of a member (67 corresponding lines) internal/dispatch/gcf/gcp.go:1001 — internal/dispatch/gcf/gcp.go:1001-1075 | internal/dispatch/gcf/gcp.go:1105-1171 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (67 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1431 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1431-1516 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:570-636 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×2
  • Edited copy of a member (57 corresponding lines) pkg/behaviourtest/steps/dispatch.go:199 — pkg/behaviourtest/steps/dispatch.go:199-255 | pkg/behaviourtest/steps/dispatch.go:273-329 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (57 corresponding lines) internal/cli/checkprotectedbranch.go:44 — internal/cli/checkprotectedbranch.go:44-100 | internal/cli/resolvemrsource.go:75-138 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) internal/dispatch/gcf/provisioner.go:651 — internal/dispatch/gcf/provisioner.go:651-695 | internal/dispatch/gcf/provisioner.go:1752-1789 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) internal/dispatch/gcf/gcp.go:433 — internal/dispatch/gcf/gcp.go:433-473 | internal/dispatch/gcf/gcp.go:1208-1245 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) internal/preset/preset.go:126 — internal/preset/preset.go:126-162 | REDACTED:574-610 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) internal/cli/agent.go:55 — internal/cli/agent.go:55-92 | internal/cli/agent.go:110-146 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/behaviourtest/steps/gateway.go:41 — pkg/behaviourtest/steps/gateway.go:41-71 | pkg/behaviourtest/steps/jirapoll_transport.go:159-181 | pkg/behaviourtest/steps/mint_probe.go:160-179 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) internal/poll/legacy_mirror.go:129 — internal/poll/legacy_mirror.go:129-149 | internal/poll/state.go:191-213 | internal/poll/state.go:347-366 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) REDACTED:1483 — REDACTED:1483-1517 | REDACTED:1522-1557 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) internal/cli/inference.go:202 — internal/cli/inference.go:202-236 | internal/cli/inference.go:271-318 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 22+ corresponding lines) REDACTED:4233 — REDACTED:4233-4254 | REDACTED:4336-4357 | internal/forge/gitlab/mr.go:275-304 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) REDACTED:743 — REDACTED:743-764 | REDACTED:766-787 | REDACTED:1234-1256 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) internal/cli/run_gateway_route.go:724 — internal/cli/run_gateway_route.go:724-744 | internal/cli/run_jira.go:749-765 | internal/cli/run_openai.go:1263-1279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) internal/repos/preflight_read_cache.go:97 — internal/repos/preflight_read_cache.go:97-113 | internal/repos/preflight_read_cache.go:116-132 | internal/repos/preflight_read_cache.go:135-151 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) internal/cli/repos_gitlab.go:462 — internal/cli/repos_gitlab.go:462-468 | internal/cli/repos_gitlab_service_accounts.go:301-307 | internal/gitlablifecycle/trigger_account.go:68-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/behaviourtest/steps/dispatch.go:619 — pkg/behaviourtest/steps/dispatch.go:619-625 | pkg/behaviourtest/steps/fork.go:417-424 | pkg/behaviourtest/steps/triage.go:201-215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 9+ corresponding lines) internal/forge/gitlab/issue.go:146 — internal/forge/gitlab/issue.go:146-154 | internal/forge/gitlab/issue.go:159-173 | internal/forge/gitlab/mr.go:407-415 | internal/forge/gitlab/service_accounts.go:181-189 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) internal/cli/agent_openai.go:96 — internal/cli/agent_openai.go:96-104 | internal/cli/run.go:7957-7965 | internal/config/agents.go:8-16 | internal/config/managed_safety.go:333-341 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) internal/repos/manifest_set.go:452 — internal/repos/manifest_set.go:452-454 | REDACTED:573-575 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) internal/cli/run_gateway_route.go:224 — internal/cli/run_gateway_route.go:224-226 | internal/cli/run_jira.go:421-423 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) internal/e2etest/testutil.go:305 — internal/e2etest/testutil.go:305-330 | internal/e2etest/testutil.go:355-380 — both copies are in the same file, so extract the 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 `internal/e2etest/testutil.go:305` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/e2etest/testutil.go:304` calls `logf` and `internal/e2etest/testutil.go:354` 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 (26 lines × 2) internal/dispatch/gcf/gcp.go:1341 — internal/dispatch/gcf/gcp.go:1341-1366 | internal/dispatch/gcf/gcp.go:1398-1423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) internal/config/interfaces.go:807 — internal/config/interfaces.go:807-829 | internal/config/interfaces.go:840-862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) pkg/behaviourtest/steps/dispatch.go:209 — pkg/behaviourtest/steps/dispatch.go:209-231 | pkg/behaviourtest/steps/dispatch.go:284-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) internal/cli/mint.go:2125 — internal/cli/mint.go:2125-2145 | internal/cli/mint.go:2207-2227 — both copies are in the same file, so extract the 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 (21 lines × 2) internal/e2etest/testutil.go:201 — internal/e2etest/testutil.go:201-221 | internal/e2etest/testutil.go:332-352 — both copies are in the same file, so extract the 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 `internal/e2etest/testutil.go:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/e2etest/testutil.go:194` calls `logf` and `internal/e2etest/testutil.go:330` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) internal/dispatch/gcf/provisioner.go:777 — internal/dispatch/gcf/provisioner.go:777-796 | internal/dispatch/gcf/provisioner.go:953-972 — both copies are in the same file, so extract the 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 (20 lines × 2) pkg/behaviourtest/steps/base_dispatch.go:232 — pkg/behaviourtest/steps/base_dispatch.go:232-251 | pkg/behaviourtest/steps/dispatch.go:300-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) internal/mintcore/jwks_verifier.go:127 — internal/mintcore/jwks_verifier.go:127-143 | internal/mintcore/sts_verifier.go:114-131 — 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 `internal/mintcore/jwks_verifier.go:127` 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 (17–18 lines × 2) internal/security/hooks/ssrf_pretool.py:1042 — internal/security/hooks/ssrf_pretool.py:1042-1059 | internal/security/hooks/tirith_check.py:448-464 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) internal/cli/foreign.go:187 — internal/cli/foreign.go:187-202 | internal/cli/foreign.go:248-264 — both copies are in the same file, so extract the 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 `internal/cli/foreign.go:248` 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. 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 (16–17 lines × 2) internal/dispatch/gcf/gcp.go:1701 — internal/dispatch/gcf/gcp.go:1701-1716 | internal/dispatch/gcf/gcp.go:1863-1879 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:1701` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) pkg/behaviourtest/steps/base_dispatch.go:241 — pkg/behaviourtest/steps/base_dispatch.go:241-256 | pkg/behaviourtest/steps/dispatch.go:235-250 | pkg/behaviourtest/steps/dispatch.go:309-324 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 3) internal/security/hooks/secret_redact_posttool.py:593 — internal/security/hooks/secret_redact_posttool.py:593-608 | internal/security/hooks/tirith_check.py:69-84 | internal/security/hooks/unicode_posttool.py:91-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) internal/dispatch/gcf/gcp.go:1042 — internal/dispatch/gcf/gcp.go:1042-1056 | internal/dispatch/gcf/gcp.go:1139-1152 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/gcp.go:1042` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) REDACTED:2253 — REDACTED:2253-2267 | REDACTED:2333-2346 — both copies are in the same file, so extract the 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:2253` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) REDACTED:1769 — REDACTED:1769-1782 | REDACTED:2014-2027 | REDACTED:2549-2562 — 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:1769` 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 (14 lines × 3) internal/security/hooks/canary_posttool.py:72 — internal/security/hooks/canary_posttool.py:72-85 | internal/security/hooks/canary_pretool.py:63-76 | internal/security/hooks/tool_allowlist_pretool.py:195-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) internal/cli/mint.go:2156 — internal/cli/mint.go:2156-2167 | internal/cli/mint.go:2238-2249 | internal/cli/mint.go:2306-2317 — 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 (12 lines × 3) internal/harness/compose.go:1355 — internal/harness/compose.go:1355-1366 | internal/harness/compose.go:1392-1403 | internal/harness/compose.go:1428-1439 — 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 `internal/harness/compose.go:1355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) internal/dispatch/gcf/provisioner.go:359 — internal/dispatch/gcf/provisioner.go:359-367 | internal/dispatch/gcf/provisioner.go:397-405 | internal/dispatch/gcf/provisioner.go:416-424 | internal/dispatch/gcf/provisioner.go:459-467 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/dispatch/gcf/provisioner.go:426` calls `Errorf` and `internal/dispatch/gcf/provisioner.go:469` 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 (9 lines × 4) internal/runtime/claude.go:505 — internal/runtime/claude.go:505-513 | internal/runtime/codex_run.go:599-607 | internal/runtime/opencode_run.go:453-461 | internal/runtime/pi_run.go:1071-1079 — 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 `internal/runtime/claude.go:505` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) internal/runtime/claude.go:562 — internal/runtime/claude.go:562-570 | internal/runtime/opencode_transcript.go:25-32 | internal/runtime/pi_transcript.go:59-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 3) internal/repos/gitlab_trigger_jobs.go:163 — internal/repos/gitlab_trigger_jobs.go:163-170 | internal/repos/gitlab_trigger_jobs.go:349-356 | internal/repos/gitlab_trigger_jobs.go:436-443 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1288 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1288-1294 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1667-1673 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:476-482 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:688-694 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) internal/dispatch/gcf/gcp.go:1282 — internal/dispatch/gcf/gcp.go:1282-1288 | internal/dispatch/gcf/gcp.go:1705-1711 | internal/dispatch/gcf/gcp.go:1780-1786 | internal/dispatch/gcf/gcp.go:1868-1874 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/dispatch/gcf/gcp.go:1282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) internal/security/unicode.go:107 — internal/security/unicode.go:107-112 | internal/security/unicode.go:122-127 | internal/security/unicode.go:164-169 — 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 `internal/security/unicode.go:107` 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 × 3) internal/cli/inference.go:165 — internal/cli/inference.go:165-170 | internal/cli/inference.go:378-383 | internal/cli/inference.go:640-645 — 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 `internal/cli/inference.go:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) internal/forge/jira/adf.go:731 — internal/forge/jira/adf.go:731-736 | internal/forge/jira/adf.go:741-747 — both copies are in the same file, so extract the 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 `internal/forge/jira/adf.go:731` 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–7 lines × 2) skills/analyze-transcript/analyze-transcript.py:883 — skills/analyze-transcript/analyze-transcript.py:883-889 | skills/analyze-transcript/analyze-transcript.py:894-899 — both copies are in the same file, so extract the 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 `skills/analyze-transcript/analyze-transcript.py:883` 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.
X2 · Cancellation propagation · Function without context.Context · ×2
  • Function without context.Context: send internal/mintcore/tracing.go:772 — `send` calls `http.NewRequestWithContext(…)` 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: handleFetch cmd/mint-wasm/main.go:151 — `handleFetch` calls `http.NewRequestWithContext(…)` 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, …)`.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark web/public/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Heading level jumps from h1 to h4 · ×1
  • Heading level jumps from h1 to h4 web/public/index.html:857 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement docs/.vitepress/theme/components/VPLocalSearchBox.vue:834 — `.result` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×1
  • Animation without a prefers-reduced-motion guard docs/.vitepress/theme/custom.css:236 — `.reading-progress` moves (`transition: width 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D1 · Cyclomatic Complexity · cli.runAgent (cyclomatic 469) · ×1
  • cli.runAgent (cyclomatic 469) internal/cli/run.go:493 — cli.runAgent has cyclomatic complexity 469 (threshold 15). Of this number, 425 points are the body's own statements and 44 belong to 13 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.rotateOneRole (cyclomatic 163) · ×1
  • repos.rotateOneRole (cyclomatic 163) internal/repos/gitlab_roles_rotate.go:354 — repos.rotateOneRole has cyclomatic complexity 163 (threshold 15). Of this number, 160 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runReposInstall (cyclomatic 154) · ×1
  • cli.runReposInstall (cyclomatic 154) internal/cli/repos.go:604 — cli.runReposInstall has cyclomatic complexity 154 (threshold 15). Of this number, 138 points are the body's own statements and 16 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.resolveFromLock (cyclomatic 149) · ×1
  • cli.resolveFromLock (cyclomatic 149) internal/cli/lock.go:944 — cli.resolveFromLock has cyclomatic complexity 149 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.Run (cyclomatic 139) · ×1
  • Poller.Run (cyclomatic 139) internal/poll/poll.go:74 — Poller.Run has cyclomatic complexity 139 (threshold 15). Of this number, 126 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.Converge (cyclomatic 122) · ×1
  • repos.Converge (cyclomatic 122) internal/repos/converge.go:770 — repos.Converge has cyclomatic complexity 122 (threshold 15). Of this number, 86 points are the body's own statements and 36 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runPerRepoInstall (cyclomatic 110) · ×1
  • cli.runPerRepoInstall (cyclomatic 110) internal/cli/admin.go:339 — cli.runPerRepoInstall has cyclomatic complexity 110 (threshold 15). Of this number, 100 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ensureGitLabWebhookFastPath (cyclomatic 108) · ×1
  • repos.ensureGitLabWebhookFastPath (cyclomatic 108) internal/repos/gitlab_webhook.go:1956 — repos.ensureGitLabWebhookFastPath has cyclomatic complexity 108 (threshold 15). Of this number, 100 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeRepo (cyclomatic 83) · ×1
  • repos.convergeRepo (cyclomatic 83) internal/repos/converge.go:1496 — repos.convergeRepo has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.parsePiStream (cyclomatic 83) · ×1
  • runtime.parsePiStream (cyclomatic 83) internal/runtime/pi_progress.go:356 — runtime.parsePiStream has cyclomatic complexity 83 (threshold 15). Of this number, 54 points are the body's own statements and 29 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Provisioner.provisionSelfManaged (cyclomatic 79) · ×1
  • Provisioner.provisionSelfManaged (cyclomatic 79) internal/dispatch/gcf/provisioner.go:824 — Provisioner.provisionSelfManaged has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runMintDeployCloudflare (cyclomatic 77) · ×1
  • cli.runMintDeployCloudflare (cyclomatic 77) internal/cli/mint.go:910 — cli.runMintDeployCloudflare has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runGitHubSetupPerRepo (cyclomatic 74) · ×1
  • cli.runGitHubSetupPerRepo (cyclomatic 74) internal/cli/github.go:186 — cli.runGitHubSetupPerRepo has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.CleanupScenario (cyclomatic 74) · ×1
  • steps.CleanupScenario (cyclomatic 74) pkg/behaviourtest/steps/cleanup.go:116 — steps.CleanupScenario has cyclomatic complexity 74 (threshold 15). Of this number, 69 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeRefFiles (cyclomatic 71) · ×1
  • repos.convergeRefFiles (cyclomatic 71) internal/repos/converge.go:2979 — repos.convergeRefFiles has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.resolveBaseScripts (cyclomatic 69) · ×1
  • harness.resolveBaseScripts (cyclomatic 69) internal/harness/compose.go:1098 — harness.resolveBaseScripts has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.parseClaudeStream (cyclomatic 68) · ×1
  • runtime.parseClaudeStream (cyclomatic 68) internal/runtime/claude_progress.go:244 — runtime.parseClaudeStream has cyclomatic complexity 68 (threshold 15). Of this number, 66 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.discoverAllEvents (cyclomatic 63) · ×1
  • Poller.discoverAllEvents (cyclomatic 63) internal/poll/events.go:73 — Poller.discoverAllEvents has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.lockOneAgent (cyclomatic 59) · ×1
  • cli.lockOneAgent (cyclomatic 59) internal/cli/lock.go:208 — cli.lockOneAgent has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ProbeComponentsForAuth (cyclomatic 59) · ×1
  • repos.ProbeComponentsForAuth (cyclomatic 59) internal/repos/probe.go:87 — repos.ProbeComponentsForAuth has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · slotAllocator.Claim (cyclomatic 58) · ×1
  • slotAllocator.Claim (cyclomatic 58) REDACTED:408 — slotAllocator.Claim has cyclomatic complexity 58 (threshold 15). Of this number, 57 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runMintStatus (cyclomatic 56) · ×1
  • cli.runMintStatus (cyclomatic 56) internal/cli/mint.go:1753 — cli.runMintStatus 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.
D1 · Cyclomatic Complexity · resolve.ResolveHarness (cyclomatic 56) · ×1
  • resolve.ResolveHarness (cyclomatic 56) internal/resolve/resolve.go:285 — resolve.ResolveHarness 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.
D1 · Cyclomatic Complexity · runtime.parseCodexStream (cyclomatic 56) · ×1
  • runtime.parseCodexStream (cyclomatic 56) internal/runtime/codex_progress.go:373 — runtime.parseCodexStream has cyclomatic complexity 56 (threshold 15). Of this number, 25 points are the body's own statements and 31 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.decodeGitLabTriggerAccountState (cyclomatic 54) · ×1
  • repos.decodeGitLabTriggerAccountState (cyclomatic 54) internal/repos/gitlab_trigger_account.go:281 — repos.decodeGitLabTriggerAccountState has cyclomatic complexity 54 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · repos.DiagnoseGitLabWebhook (cyclomatic 54) · ×1
  • repos.DiagnoseGitLabWebhook (cyclomatic 54) internal/repos/gitlab_webhook_status.go:66 — repos.DiagnoseGitLabWebhook has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Handler.serveHTTP (cyclomatic 53) · ×1
  • Handler.serveHTTP (cyclomatic 53) internal/mintcore/handler.go:236 — Handler.serveHTTP has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manifest.validate (cyclomatic 52) · ×1
  • Manifest.validate (cyclomatic 52) REDACTED:762 — Manifest.validate has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.toNormalizedEvent (cyclomatic 51) · ×1
  • Poller.toNormalizedEvent (cyclomatic 51) internal/poll/convert.go:23 — Poller.toNormalizedEvent has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.resolveBaseResources (cyclomatic 49) · ×1
  • harness.resolveBaseResources (cyclomatic 49) internal/harness/compose.go:1305 — harness.resolveBaseResources has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.decodeClaudeTaskProgress (cyclomatic 49) · ×1
  • runtime.decodeClaudeTaskProgress (cyclomatic 49) internal/runtime/claude_task_progress.go:46 — runtime.decodeClaudeTaskProgress has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Harness.ValidateResourceTypes (cyclomatic 48) · ×1
  • Harness.ValidateResourceTypes (cyclomatic 48) REDACTED:1169 — Harness.ValidateResourceTypes has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.triggerExtraWorkProblemForSource (cyclomatic 48) · ×1
  • repos.triggerExtraWorkProblemForSource (cyclomatic 48) internal/repos/gitlab_trigger_jobs.go:162 — repos.triggerExtraWorkProblemForSource has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.executeBehaviourOp (cyclomatic 47) · ×1
  • runtime.executeBehaviourOp (cyclomatic 47) internal/runtime/dummy.go:358 — runtime.executeBehaviourOp has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexRuntime.Run (cyclomatic 47) · ×1
  • CodexRuntime.Run (cyclomatic 47) internal/runtime/codex_run.go:519 — CodexRuntime.Run has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveClient.commitFilesTo (cyclomatic 46) · ×1
  • LiveClient.commitFilesTo (cyclomatic 46) REDACTED:1762 — LiveClient.commitFilesTo has cyclomatic complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · progressReconciler.task (cyclomatic 46) · ×1
  • progressReconciler.task (cyclomatic 46) internal/runtime/task_progress_reconciler.go:42 — progressReconciler.task has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runReposUninstall (cyclomatic 45) · ×1
  • cli.runReposUninstall (cyclomatic 45) internal/cli/repos.go:1534 — cli.runReposUninstall has cyclomatic complexity 45 (threshold 15). Of this number, 38 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.mintPollerOwnedTrigger (cyclomatic 45) · ×1
  • repos.mintPollerOwnedTrigger (cyclomatic 45) internal/repos/gitlab_webhook_poller.go:441 — repos.mintPollerOwnedTrigger has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pollerGenerationRun.attemptTrigger (cyclomatic 45) · ×1
  • pollerGenerationRun.attemptTrigger (cyclomatic 45) internal/repos/gitlab_poller_generation.go:794 — pollerGenerationRun.attemptTrigger has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · posttool_chain.main (cyclomatic 45) · ×1
  • posttool_chain.main (cyclomatic 45) internal/security/hooks/posttool_chain.py:299 — posttool_chain.main has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.LoadWithBase (cyclomatic 44) · ×1
  • harness.LoadWithBase (cyclomatic 44) internal/harness/compose.go:228 — harness.LoadWithBase has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Harness.Validate (cyclomatic 44) · ×1
  • Harness.Validate (cyclomatic 44) REDACTED:533 — Harness.Validate has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.Install (cyclomatic 44) · ×1
  • repos.Install (cyclomatic 44) internal/repos/install.go:260 — repos.Install has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.decodeClaudeStatusProgress (cyclomatic 44) · ×1
  • runtime.decodeClaudeStatusProgress (cyclomatic 44) internal/runtime/claude_status_progress.go:13 — runtime.decodeClaudeStatusProgress has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexRuntime.Bootstrap (cyclomatic 44) · ×1
  • CodexRuntime.Bootstrap (cyclomatic 44) internal/runtime/codex_bootstrap.go:131 — CodexRuntime.Bootstrap has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.checkRepoStatus (cyclomatic 43) · ×1
  • repos.checkRepoStatus (cyclomatic 43) internal/repos/status.go:298 — repos.checkRepoStatus has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manifest.validatePlatformRepos (cyclomatic 43) · ×1
  • Manifest.validatePlatformRepos (cyclomatic 43) REDACTED:927 — Manifest.validatePlatformRepos has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.resolveAgentNewOptions (cyclomatic 42) · ×1
  • cli.resolveAgentNewOptions (cyclomatic 42) internal/cli/agent_new.go:101 — cli.resolveAgentNewOptions has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.doRequest (cyclomatic 42) · ×1
  • LiveClient.doRequest (cyclomatic 42) REDACTED:569 — LiveClient.doRequest has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.provisionOwnRoles (cyclomatic 42) · ×1
  • repos.provisionOwnRoles (cyclomatic 42) internal/repos/gitlab_roles.go:449 — repos.provisionOwnRoles has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.uninstallRepoResources (cyclomatic 42) · ×1
  • repos.uninstallRepoResources (cyclomatic 42) internal/repos/uninstall.go:318 — repos.uninstallRepoResources has cyclomatic complexity 42 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.ListPullRequestReviewThreads (cyclomatic 41) · ×1
  • LiveClient.ListPullRequestReviewThreads (cyclomatic 41) internal/forge/gitlab/mr.go:878 — LiveClient.ListPullRequestReviewThreads has cyclomatic complexity 41 (threshold 15). Of this number, 31 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runLint (cyclomatic 40) · ×1
  • cli.runLint (cyclomatic 40) internal/cli/lint.go:197 — cli.runLint has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.mergeBaseIntoChild (cyclomatic 40) · ×1
  • harness.mergeBaseIntoChild (cyclomatic 40) internal/harness/compose.go:863 — harness.mergeBaseIntoChild has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.convergeInstalledServiceAccount (cyclomatic 40) · ×1
  • repos.convergeInstalledServiceAccount (cyclomatic 40) internal/repos/gitlab_service_account_converge.go:251 — repos.convergeInstalledServiceAccount has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.converge (cyclomatic 40) · ×1
  • gitLabTriggerAccountOp.converge (cyclomatic 40) internal/repos/gitlab_trigger_account.go:727 — gitLabTriggerAccountOp.converge has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PiRuntime.Bootstrap (cyclomatic 40) · ×1
  • PiRuntime.Bootstrap (cyclomatic 40) internal/runtime/pi_bootstrap.go:204 — PiRuntime.Bootstrap has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Event.Validate (cyclomatic 39) · ×1
  • Event.Validate (cyclomatic 39) internal/normevent/event.go:220 — Event.Validate has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.migrateLegacyManifestTracking (cyclomatic 39) · ×1
  • repos.migrateLegacyManifestTracking (cyclomatic 39) internal/repos/manifest_legacy_tracking.go:47 — repos.migrateLegacyManifestTracking has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.validateAgentEntries (cyclomatic 37) · ×1
  • config.validateAgentEntries (cyclomatic 37) internal/config/config.go:789 — config.validateAgentEntries has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.CheckManagedSafetyGate (cyclomatic 37) · ×1
  • config.CheckManagedSafetyGate (cyclomatic 37) internal/config/managed_safety.go:90 — config.CheckManagedSafetyGate has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.commitFilesImpl (cyclomatic 37) · ×1
  • LiveClient.commitFilesImpl (cyclomatic 37) REDACTED:1186 — LiveClient.commitFilesImpl has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.loadBaseChain (cyclomatic 37) · ×1
  • harness.loadBaseChain (cyclomatic 37) internal/harness/compose.go:454 — harness.loadBaseChain has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabExtraWorkProblem (cyclomatic 37) · ×1
  • repos.gitlabExtraWorkProblem (cyclomatic 37) internal/repos/gitlab_trigger_jobs.go:571 — repos.gitlabExtraWorkProblem has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.applyManagedLayer (cyclomatic 36) · ×1
  • config.applyManagedLayer (cyclomatic 36) internal/config/managed.go:447 — config.applyManagedLayer has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitfetch.FetchTree (cyclomatic 36) · ×1
  • gitfetch.FetchTree (cyclomatic 36) internal/gitfetch/gitfetch.go:48 — gitfetch.FetchTree has cyclomatic complexity 36 (threshold 15). Of this number, 27 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.gitlabDispatcherTemplateProblem (cyclomatic 36) · ×1
  • repos.gitlabDispatcherTemplateProblem (cyclomatic 36) internal/repos/gitlab_trigger_jobs.go:729 — repos.gitlabDispatcherTemplateProblem has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.UnmergeGitLabCI (cyclomatic 36) · ×1
  • repos.UnmergeGitLabCI (cyclomatic 36) internal/repos/gitlabci.go:1232 — repos.UnmergeGitLabCI has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.validatePiGatewayModelValue (cyclomatic 36) · ×1
  • runtime.validatePiGatewayModelValue (cyclomatic 36) internal/runtime/pi_gateway.go:189 — runtime.validatePiGatewayModelValue has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnicodeNormalizer.Scan (cyclomatic 36) · ×1
  • UnicodeNormalizer.Scan (cyclomatic 36) internal/security/unicode.go:64 — UnicodeNormalizer.Scan has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.resolveBaseProfiles (cyclomatic 35) · ×1
  • harness.resolveBaseProfiles (cyclomatic 35) internal/harness/compose.go:1533 — harness.resolveBaseProfiles has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.resolvePersonaModels (cyclomatic 35) · ×1
  • runtime.resolvePersonaModels (cyclomatic 35) internal/runtime/pi_personas.go:208 — runtime.resolvePersonaModels has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PiRuntime.Run (cyclomatic 35) · ×1
  • PiRuntime.Run (cyclomatic 35) internal/runtime/pi_run.go:1181 — PiRuntime.Run has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tirith_check.check_command (cyclomatic 35) · ×1
  • tirith_check.check_command (cyclomatic 35) internal/security/hooks/tirith_check.py:252 — tirith_check.check_command has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nextwork.classify_issue (cyclomatic 35) · ×1
  • nextwork.classify_issue (cyclomatic 35) skills/nextwork/scripts/nextwork.py:694 — nextwork.classify_issue has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nextwork.normalize_item (cyclomatic 35) · ×1
  • nextwork.normalize_item (cyclomatic 35) skills/nextwork/scripts/nextwork.py:1524 — nextwork.normalize_item has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.bootstrapEnv (cyclomatic 34) · ×1
  • cli.bootstrapEnv (cyclomatic 34) internal/cli/run.go:4271 — cli.bootstrapEnv has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e2etest.acquireOrg (cyclomatic 34) · ×1
  • e2etest.acquireOrg (cyclomatic 34) internal/e2etest/testutil.go:128 — e2etest.acquireOrg has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · envmanifest.shellCommands (cyclomatic 34) · ×1
  • envmanifest.shellCommands (cyclomatic 34) internal/envmanifest/shellexports.go:141 — envmanifest.shellCommands has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · fetch.FetchURL (cyclomatic 34) · ×1
  • fetch.FetchURL (cyclomatic 34) internal/fetch/fetch.go:136 — fetch.FetchURL has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.AppendGitLabServiceAccountStatus (cyclomatic 34) · ×1
  • ServiceAccountTokenClient.AppendGitLabServiceAccountStatus (cyclomatic 34) internal/repos/gitlab_service_account_converge.go:34 — ServiceAccountTokenClient.AppendGitLabServiceAccountStatus has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.withoutSuppliedLegacy (cyclomatic 34) · ×1
  • ServiceAccountTokenClient.withoutSuppliedLegacy (cyclomatic 34) internal/repos/gitlab_service_accounts.go:726 — ServiceAccountTokenClient.withoutSuppliedLegacy has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · analyze-transcript.cmd_network (cyclomatic 34) · ×1
  • analyze-transcript.cmd_network (cyclomatic 34) skills/analyze-transcript/analyze-transcript.py:737 — analyze-transcript.cmd_network has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.routeBuiltinAgent (cyclomatic 33) · ×1
  • cli.routeBuiltinAgent (cyclomatic 33) internal/cli/dispatch_route.go:175 — cli.routeBuiltinAgent has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.mintAgentTokenAtLevel (cyclomatic 33) · ×1
  • cli.mintAgentTokenAtLevel (cyclomatic 33) internal/cli/run.go:7646 — cli.mintAgentTokenAtLevel has cyclomatic complexity 33 (threshold 15). Of this number, 23 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.RotateGitLabRoleCredentials (cyclomatic 33) · ×1
  • repos.RotateGitLabRoleCredentials (cyclomatic 33) internal/repos/gitlab_roles_rotate.go:232 — repos.RotateGitLabRoleCredentials has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.planStaleVendoredCleanup (cyclomatic 33) · ×1
  • repos.planStaleVendoredCleanup (cyclomatic 33) internal/repos/stale_vendored.go:75 — repos.planStaleVendoredCleanup has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.releaseSchedules (cyclomatic 33) · ×1
  • gitLabTriggerAccountOp.releaseSchedules (cyclomatic 33) internal/repos/gitlab_trigger_schedules.go:729 — gitLabTriggerAccountOp.releaseSchedules has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · manifestEditor.plan (cyclomatic 33) · ×1
  • manifestEditor.plan (cyclomatic 33) internal/repos/manifest_set.go:1063 — manifestEditor.plan has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.buildPiRunCommand (cyclomatic 33) · ×1
  • runtime.buildPiRunCommand (cyclomatic 33) internal/runtime/pi_run.go:430 — runtime.buildPiRunCommand has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenCodeRuntime.Run (cyclomatic 33) · ×1
  • OpenCodeRuntime.Run (cyclomatic 33) internal/runtime/opencode_run.go:426 — OpenCodeRuntime.Run 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nextwork.classify_pr (cyclomatic 33) · ×1
  • nextwork.classify_pr (cyclomatic 33) skills/nextwork/scripts/nextwork.py:938 — nextwork.classify_pr has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveGCFClient.GetServiceRevisionInfo (cyclomatic 32) · ×1
  • LiveGCFClient.GetServiceRevisionInfo (cyclomatic 32) internal/dispatch/gcf/gcp.go:1862 — LiveGCFClient.GetServiceRevisionInfo has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.resolveBaseProviders (cyclomatic 32) · ×1
  • harness.resolveBaseProviders (cyclomatic 32) internal/harness/compose.go:1626 — harness.resolveBaseProviders has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabWebhookReadiness (cyclomatic 32) · ×1
  • repos.gitlabWebhookReadiness (cyclomatic 32) internal/repos/gitlab_webhook.go:566 — repos.gitlabWebhookReadiness has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.ensureGitLabWebhookAccountRoute (cyclomatic 32) · ×1
  • repos.ensureGitLabWebhookAccountRoute (cyclomatic 32) internal/repos/gitlab_webhook_trigger_account.go:283 — repos.ensureGitLabWebhookAccountRoute has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.resolveCodexChildModels (cyclomatic 32) · ×1
  • runtime.resolveCodexChildModels (cyclomatic 32) internal/runtime/codex_personas.go:108 — runtime.resolveCodexChildModels has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.BuildConfigMap (cyclomatic 31) · ×1
  • harness.BuildConfigMap (cyclomatic 31) internal/harness/forge.go:460 — harness.BuildConfigMap has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.collectConvergeScaffoldFiles (cyclomatic 31) · ×1
  • repos.collectConvergeScaffoldFiles (cyclomatic 31) internal/repos/converge.go:3775 — repos.collectConvergeScaffoldFiles has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ContainGitLabPoller (cyclomatic 31) · ×1
  • repos.ContainGitLabPoller (cyclomatic 31) internal/repos/gitlab_poller_credential_policy.go:111 — repos.ContainGitLabPoller has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.diagnoseGitLabTriggerAccount (cyclomatic 31) · ×1
  • repos.diagnoseGitLabTriggerAccount (cyclomatic 31) internal/repos/gitlab_trigger_account_status.go:59 — repos.diagnoseGitLabTriggerAccount has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.settleHarnessDispatchCount (cyclomatic 31) · ×1
  • Driver.settleHarnessDispatchCount (cyclomatic 31) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1831 — Driver.settleHarnessDispatchCount has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.pinnedSetupFlags (cyclomatic 30) · ×1
  • cli.pinnedSetupFlags (cyclomatic 30) internal/cli/github.go:682 — cli.pinnedSetupFlags has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runLockAll (cyclomatic 30) · ×1
  • cli.runLockAll (cyclomatic 30) internal/cli/lock.go:519 — cli.runLockAll has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e2etest.acquireOrgFromClient (cyclomatic 30) · ×1
  • e2etest.acquireOrgFromClient (cyclomatic 30) internal/e2etest/testutil.go:294 — e2etest.acquireOrgFromClient has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.detectChanges (cyclomatic 30) · ×1
  • Poller.detectChanges (cyclomatic 30) internal/jirapoll/discover.go:46 — Poller.detectChanges has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.Run (cyclomatic 30) · ×1
  • Poller.Run (cyclomatic 30) internal/jirapoll/poller.go:110 — Poller.Run has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.revalidateAdditions (cyclomatic 30) · ×1
  • Poller.revalidateAdditions (cyclomatic 30) internal/poll/state.go:1189 — Poller.revalidateAdditions has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeScaffoldFiles (cyclomatic 30) · ×1
  • repos.convergeScaffoldFiles (cyclomatic 30) internal/repos/converge.go:3285 — repos.convergeScaffoldFiles has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.editManifestValue (cyclomatic 30) · ×1
  • repos.editManifestValue (cyclomatic 30) internal/repos/manifest_set.go:46 — repos.editManifestValue has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.DeleteManagedServiceAccounts (cyclomatic 30) · ×1
  • ServiceAccountTokenClient.DeleteManagedServiceAccounts (cyclomatic 30) internal/repos/gitlab_service_account_converge.go:571 — ServiceAccountTokenClient.DeleteManagedServiceAccounts has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.CreateProjectAccessToken (cyclomatic 30) · ×1
  • ServiceAccountTokenClient.CreateProjectAccessToken (cyclomatic 30) internal/repos/gitlab_service_accounts.go:347 — ServiceAccountTokenClient.CreateProjectAccessToken has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · workflowExprParser.parseOperand (cyclomatic 30) · ×1
  • workflowExprParser.parseOperand (cyclomatic 30) internal/repos/gitlab_workflow_admission.go:230 — workflowExprParser.parseOperand has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · runtime.ValidatePiGatewayModelsFile (cyclomatic 30) · ×1
  • runtime.ValidatePiGatewayModelsFile (cyclomatic 30) internal/runtime/pi_gateway.go:87 — runtime.ValidatePiGatewayModelsFile has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.describeDispatchRuns (cyclomatic 30) · ×1
  • steps.describeDispatchRuns (cyclomatic 30) pkg/behaviourtest/steps/debuglogs.go:803 — steps.describeDispatchRuns has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolve-precommit-tools.resolve (cyclomatic 30) · ×1
  • resolve-precommit-tools.resolve (cyclomatic 30) internal/scaffold/fullsend-repo/scripts/resolve-precommit-tools.py:108 — resolve-precommit-tools.resolve has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runMintDeployGCP (cyclomatic 29) · ×1
  • cli.runMintDeployGCP (cyclomatic 29) internal/cli/mint.go:755 — cli.runMintDeployGCP has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.stageOverriddenSkill (cyclomatic 29) · ×1
  • cli.stageOverriddenSkill (cyclomatic 29) internal/cli/skill_staging.go:107 — cli.stageOverriddenSkill has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Service.HandleFetch (cyclomatic 29) · ×1
  • Service.HandleFetch (cyclomatic 29) internal/fetchsvc/service.go:147 — Service.HandleFetch has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Harness.validateForge (cyclomatic 29) · ×1
  • Harness.validateForge (cyclomatic 29) internal/harness/forge.go:69 — Harness.validateForge has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Harness.ResolveRelativeTo (cyclomatic 29) · ×1
  • Harness.ResolveRelativeTo (cyclomatic 29) REDACTED:782 — Harness.ResolveRelativeTo has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repoEnsurer.deleteLeftoverForkOwned (cyclomatic 29) · ×1
  • repoEnsurer.deleteLeftoverForkOwned (cyclomatic 29) pkg/behaviourtest/drivers/install/ensure.go:470 — repoEnsurer.deleteLeftoverForkOwned has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · binary.extractSourceTree (cyclomatic 28) · ×1
  • binary.extractSourceTree (cyclomatic 28) internal/binary/download.go:234 — binary.extractSourceTree has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.restrictGitLabEndpointsToForge (cyclomatic 28) · ×1
  • cli.restrictGitLabEndpointsToForge (cyclomatic 28) internal/cli/gitlab_profile.go:289 — cli.restrictGitLabEndpointsToForge has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runInferenceGatewayStatus (cyclomatic 28) · ×1
  • cli.runInferenceGatewayStatus (cyclomatic 28) internal/cli/inference_gateway.go:189 — cli.runInferenceGatewayStatus has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveClient.do (cyclomatic 28) · ×1
  • LiveClient.do (cyclomatic 28) internal/forge/jira/client.go:350 — LiveClient.do has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeSchedules (cyclomatic 28) · ×1
  • repos.convergeSchedules (cyclomatic 28) internal/repos/converge.go:2532 — repos.convergeSchedules has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.planAccountSchedules (cyclomatic 28) · ×1
  • gitLabTriggerAccountOp.planAccountSchedules (cyclomatic 28) internal/repos/gitlab_trigger_schedules.go:422 — gitLabTriggerAccountOp.planAccountSchedules has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · progressReconciler.taskProgressIdentity (cyclomatic 28) · ×1
  • progressReconciler.taskProgressIdentity (cyclomatic 28) internal/runtime/task_progress_reconciler.go:164 — progressReconciler.taskProgressIdentity has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventRenderer.Handle (cyclomatic 28) · ×1
  • EventRenderer.Handle (cyclomatic 28) internal/runtime/renderer.go:43 — EventRenderer.Handle has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tracecontext.NormalizeInstance (cyclomatic 28) · ×1
  • tracecontext.NormalizeInstance (cyclomatic 28) internal/telemetry/tracecontext/identity.go:145 — tracecontext.NormalizeInstance has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runAgentSet (cyclomatic 27) · ×1
  • cli.runAgentSet (cyclomatic 27) internal/cli/agent.go:214 — cli.runAgentSet has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.printStatusTable (cyclomatic 27) · ×1
  • cli.printStatusTable (cyclomatic 27) internal/cli/repos.go:251 — cli.printStatusTable has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · gcf.bundleFunctionSource (cyclomatic 27) · ×1
  • gcf.bundleFunctionSource (cyclomatic 27) internal/dispatch/gcf/provisioner.go:1910 — gcf.bundleFunctionSource has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.fetchBaseScriptOrDir (cyclomatic 27) · ×1
  • harness.fetchBaseScriptOrDir (cyclomatic 27) internal/harness/compose.go:1981 — harness.fetchBaseScriptOrDir has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.dispatchWebhookEvents (cyclomatic 27) · ×1
  • Poller.dispatchWebhookEvents (cyclomatic 27) internal/poll/webhook_dispatch.go:170 — Poller.dispatchWebhookEvents has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.managedServiceAccountList (cyclomatic 27) · ×1
  • ServiceAccountTokenClient.managedServiceAccountList (cyclomatic 27) internal/repos/gitlab_service_accounts.go:241 — ServiceAccountTokenClient.managedServiceAccountList has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.listServiceAccountTokens (cyclomatic 27) · ×1
  • ServiceAccountTokenClient.listServiceAccountTokens (cyclomatic 27) internal/repos/gitlab_service_accounts.go:923 — ServiceAccountTokenClient.listServiceAccountTokens has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tracecontext.Parse (cyclomatic 27) · ×1
  • tracecontext.Parse (cyclomatic 27) internal/telemetry/tracecontext/envelope.go:267 — tracecontext.Parse 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps.givenURLSourcedCustomHarness (cyclomatic 27) · ×1
  • steps.givenURLSourcedCustomHarness (cyclomatic 27) pkg/behaviourtest/steps/url_dispatch.go:265 — steps.givenURLSourcedCustomHarness has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runGatewayRefresh (cyclomatic 26) · ×1
  • cli.runGatewayRefresh (cyclomatic 26) internal/cli/run_gateway_route.go:611 — cli.runGatewayRefresh has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.fetchBaseFile (cyclomatic 26) · ×1
  • harness.fetchBaseFile (cyclomatic 26) internal/harness/compose.go:1790 — harness.fetchBaseFile has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Harness.ValidateFilesExist (cyclomatic 26) · ×1
  • Harness.ValidateFilesExist (cyclomatic 26) REDACTED:998 — Harness.ValidateFilesExist has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.decodePollerGenerations (cyclomatic 26) · ×1
  • repos.decodePollerGenerations (cyclomatic 26) internal/repos/gitlab_poller_generation.go:230 — repos.decodePollerGenerations has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.retireSupersededPollerGeneration (cyclomatic 26) · ×1
  • repos.retireSupersededPollerGeneration (cyclomatic 26) internal/repos/gitlab_poller_retirement.go:90 — repos.retireSupersededPollerGeneration has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.CleanupGitLabRoleIdentityLocked (cyclomatic 26) · ×1
  • repos.CleanupGitLabRoleIdentityLocked (cyclomatic 26) internal/repos/gitlab_roles_cleanup.go:99 — repos.CleanupGitLabRoleIdentityLocked has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.HasFullsendEntries (cyclomatic 26) · ×1
  • repos.HasFullsendEntries (cyclomatic 26) internal/repos/gitlabci.go:445 — repos.HasFullsendEntries has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.EnsureManagedConfigDefaults (cyclomatic 26) · ×1
  • repos.EnsureManagedConfigDefaults (cyclomatic 26) internal/repos/managed_config_writeback.go:331 — repos.EnsureManagedConfigDefaults has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus (cyclomatic 26) · ×1
  • ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus (cyclomatic 26) internal/repos/gitlab_supplied_provenance.go:767 — ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.injectFrontmatterSkills (cyclomatic 26) · ×1
  • runtime.injectFrontmatterSkills (cyclomatic 26) internal/runtime/frontmatter_skills.go:146 — runtime.injectFrontmatterSkills has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Setup.Run (cyclomatic 25) · ×1
  • Setup.Run (cyclomatic 25) internal/appsetup/appsetup.go:230 — Setup.Run has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.submitFormalReviewWithDiffs (cyclomatic 25) · ×1
  • cli.submitFormalReviewWithDiffs (cyclomatic 25) REDACTED:502 — cli.submitFormalReviewWithDiffs has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.renderJiraSiteProfileFrom (cyclomatic 25) · ×1
  • cli.renderJiraSiteProfileFrom (cyclomatic 25) internal/cli/run_jira.go:237 — cli.renderJiraSiteProfileFrom has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jira.adfMarkdownBlock (cyclomatic 25) · ×1
  • jira.adfMarkdownBlock (cyclomatic 25) internal/forge/jira/adf.go:984 — jira.adfMarkdownBlock has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.resolveBaseHostFiles (cyclomatic 25) · ×1
  • harness.resolveBaseHostFiles (cyclomatic 25) internal/harness/compose.go:1455 — harness.resolveBaseHostFiles has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabRootCIDispatcherProblem (cyclomatic 25) · ×1
  • repos.gitlabRootCIDispatcherProblem (cyclomatic 25) internal/repos/gitlab_webhook.go:1535 — repos.gitlabRootCIDispatcherProblem has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeGitLabWebhookHook (cyclomatic 25) · ×1
  • repos.convergeGitLabWebhookHook (cyclomatic 25) internal/repos/gitlab_webhook.go:2690 — repos.convergeGitLabWebhookHook has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolve.resolveSkillDirURL (cyclomatic 25) · ×1
  • resolve.resolveSkillDirURL (cyclomatic 25) internal/resolve/resolve.go:675 — resolve.resolveSkillDirURL has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.parseOpenCodeStream (cyclomatic 25) · ×1
  • runtime.parseOpenCodeStream (cyclomatic 25) internal/runtime/opencode_progress.go:111 — runtime.parseOpenCodeStream has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sharedOrgLock.join (cyclomatic 25) · ×1
  • sharedOrgLock.join (cyclomatic 25) pkg/behaviourtest/drivers/install/orglock.go:172 — sharedOrgLock.join has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentnew.Generate (cyclomatic 24) · ×1
  • agentnew.Generate (cyclomatic 24) internal/agentnew/generate.go:63 — agentnew.Generate has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runIssuesCreate (cyclomatic 24) · ×1
  • cli.runIssuesCreate (cyclomatic 24) internal/cli/issues.go:294 — cli.runIssuesCreate has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.ReadLegacyTracking (cyclomatic 24) · ×1
  • config.ReadLegacyTracking (cyclomatic 24) internal/config/legacy_tracking.go:83 — config.ReadLegacyTracking has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evalmeasure.ExportOTLPScores (cyclomatic 24) · ×1
  • evalmeasure.ExportOTLPScores (cyclomatic 24) internal/evalmeasure/export_otlp.go:96 — evalmeasure.ExportOTLPScores has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jira.resolveTextEscapes (cyclomatic 24) · ×1
  • jira.resolveTextEscapes (cyclomatic 24) internal/forge/jira/adf.go:703 — jira.resolveTextEscapes has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.validateOverlayForgeConfigInherit (cyclomatic 24) · ×1
  • harness.validateOverlayForgeConfigInherit (cyclomatic 24) internal/harness/forge.go:156 — harness.validateOverlayForgeConfigInherit has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.LockGitLabProject (cyclomatic 24) · ×1
  • repos.LockGitLabProject (cyclomatic 24) internal/repos/gitlab_roles.go:67 — repos.LockGitLabProject has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.valueNode (cyclomatic 24) · ×1
  • repos.valueNode (cyclomatic 24) internal/repos/manifest_set.go:728 — repos.valueNode has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitlabJiraPollReconciler.Ensure (cyclomatic 24) · ×1
  • gitlabJiraPollReconciler.Ensure (cyclomatic 24) internal/repos/gitlab_jira_poll.go:79 — gitlabJiraPollReconciler.Ensure has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.rewriteFrontmatterSkills (cyclomatic 24) · ×1
  • runtime.rewriteFrontmatterSkills (cyclomatic 24) internal/runtime/frontmatter_skills.go:33 — runtime.rewriteFrontmatterSkills has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PiRuntime.piExecModel (cyclomatic 24) · ×1
  • PiRuntime.piExecModel (cyclomatic 24) internal/runtime/pi_run.go:1056 — PiRuntime.piExecModel has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps.parseDummyAgentTable (cyclomatic 24) · ×1
  • steps.parseDummyAgentTable (cyclomatic 24) pkg/behaviourtest/steps/dummy_agent.go:37 — steps.parseDummyAgentTable has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · analyze-transcript._accumulate_stats (cyclomatic 24) · ×1
  • analyze-transcript._accumulate_stats (cyclomatic 24) skills/analyze-transcript/analyze-transcript.py:290 — analyze-transcript._accumulate_stats has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nextwork.build_queue (cyclomatic 24) · ×1
  • nextwork.build_queue (cyclomatic 24) skills/nextwork/scripts/nextwork.py:1881 — nextwork.build_queue has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.scanPluginTree (cyclomatic 23) · ×1
  • cli.scanPluginTree (cyclomatic 23) internal/cli/bootstrap_scan.go:106 — cli.scanPluginTree has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 110). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.newPollCmd (cyclomatic 23) · ×1
  • cli.newPollCmd (cyclomatic 23) internal/cli/poll.go:26 — cli.newPollCmd has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 47). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.newReconcileStatusCmd (cyclomatic 23) · ×1
  • cli.newReconcileStatusCmd (cyclomatic 23) internal/cli/reconcilestatus.go:36 — cli.newReconcileStatusCmd 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 one function literal inside it that branches (line 65). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.resolveOpenAICredential (cyclomatic 23) · ×1
  • cli.resolveOpenAICredential (cyclomatic 23) internal/cli/run_openai.go:516 — cli.resolveOpenAICredential has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveGCFClient.UpdateServiceEnvVars (cyclomatic 23) · ×1
  • LiveGCFClient.UpdateServiceEnvVars (cyclomatic 23) internal/dispatch/gcf/gcp.go:1506 — LiveGCFClient.UpdateServiceEnvVars has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · e2eauth.Check (cyclomatic 23) · ×1
  • e2eauth.Check (cyclomatic 23) internal/e2eauth/check.go:43 — e2eauth.Check has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.fetchBaseDir (cyclomatic 23) · ×1
  • harness.fetchBaseDir (cyclomatic 23) internal/harness/compose.go:2387 — harness.fetchBaseDir has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · layers.deliverBranchAndPR (cyclomatic 23) · ×1
  • layers.deliverBranchAndPR (cyclomatic 23) internal/layers/commit.go:333 — layers.deliverBranchAndPR has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeContentDriftFiles (cyclomatic 23) · ×1
  • repos.convergeContentDriftFiles (cyclomatic 23) internal/repos/converge.go:3453 — repos.convergeContentDriftFiles has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.resolveExtendsAdmission (cyclomatic 23) · ×1
  • repos.resolveExtendsAdmission (cyclomatic 23) internal/repos/gitlab_trigger_job_templates.go:128 — repos.resolveExtendsAdmission has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabTriggerOwnerSafety (cyclomatic 23) · ×1
  • repos.gitlabTriggerOwnerSafety (cyclomatic 23) internal/repos/gitlab_webhook.go:861 — repos.gitlabTriggerOwnerSafety has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · workflowExprParser.parseComparison (cyclomatic 23) · ×1
  • workflowExprParser.parseComparison (cyclomatic 23) internal/repos/gitlab_workflow_admission.go:171 — workflowExprParser.parseComparison has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.mergeAgentProgress (cyclomatic 23) · ×1
  • runtime.mergeAgentProgress (cyclomatic 23) internal/runtime/task_progress_reconciler.go:256 — runtime.mergeAgentProgress has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CodexRuntime.ExtractTranscripts (cyclomatic 23) · ×1
  • CodexRuntime.ExtractTranscripts (cyclomatic 23) internal/runtime/codex_transcript.go:40 — CodexRuntime.ExtractTranscripts has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · multiPunctAnnotation.tokenAnnotation (cyclomatic 23) · ×1
  • multiPunctAnnotation.tokenAnnotation (cyclomatic 23) internal/sentencetoken/annotate.go:150 — multiPunctAnnotation.tokenAnnotation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gather.classify (cyclomatic 23) · ×1
  • gather.classify (cyclomatic 23) skills/user-forum-whats-new/scripts/gather.py:168 — gather.classify has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.profileIssuesCredential (cyclomatic 22) · ×1
  • cli.profileIssuesCredential (cyclomatic 22) internal/cli/gitlab_profile.go:579 — cli.profileIssuesCredential has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.ensureOpenAIProvider (cyclomatic 22) · ×1
  • cli.ensureOpenAIProvider (cyclomatic 22) internal/cli/run_openai.go:890 — cli.ensureOpenAIProvider has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · contentCollector.Result (cyclomatic 22) · ×1
  • contentCollector.Result (cyclomatic 22) internal/cli/content_collector.go:585 — contentCollector.Result has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e2etest.acquireLock (cyclomatic 22) · ×1
  • e2etest.acquireLock (cyclomatic 22) internal/e2etest/lock.go:27 — e2etest.acquireLock has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.GetRawFileContentAtRef (cyclomatic 22) · ×1
  • LiveClient.GetRawFileContentAtRef (cyclomatic 22) REDACTED:2368 — LiveClient.GetRawFileContentAtRef has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveClient.CreatePullRequestReview (cyclomatic 22) · ×1
  • LiveClient.CreatePullRequestReview (cyclomatic 22) internal/forge/gitlab/mr.go:476 — LiveClient.CreatePullRequestReview has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · vertexauth.prepareGitHubWIF (cyclomatic 22) · ×1
  • vertexauth.prepareGitHubWIF (cyclomatic 22) internal/inference/vertexauth/vertexauth.go:83 — vertexauth.prepareGitHubWIF has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.removeObsoleteInferenceSecrets (cyclomatic 22) · ×1
  • repos.removeObsoleteInferenceSecrets (cyclomatic 22) internal/repos/converge.go:567 — repos.removeObsoleteInferenceSecrets has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.CheckOrphanVars (cyclomatic 22) · ×1
  • repos.CheckOrphanVars (cyclomatic 22) internal/repos/drift.go:195 — repos.CheckOrphanVars has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.cutOverPollerGeneration (cyclomatic 22) · ×1
  • repos.cutOverPollerGeneration (cyclomatic 22) internal/repos/gitlab_poller_cutover.go:406 — repos.cutOverPollerGeneration has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.convergeGitLabTriggerAccountLocked (cyclomatic 22) · ×1
  • repos.convergeGitLabTriggerAccountLocked (cyclomatic 22) internal/repos/gitlab_trigger_account.go:494 — repos.convergeGitLabTriggerAccountLocked has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.diffLineMatches (cyclomatic 22) · ×1
  • repos.diffLineMatches (cyclomatic 22) internal/repos/gitlabci_format.go:174 — repos.diffLineMatches has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · repos.RemoveFromManifest (cyclomatic 22) · ×1
  • repos.RemoveFromManifest (cyclomatic 22) internal/repos/manifest_edit.go:95 — repos.RemoveFromManifest has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.resolveManifestPath (cyclomatic 22) · ×1
  • repos.resolveManifestPath (cyclomatic 22) internal/repos/manifest_set.go:498 — repos.resolveManifestPath has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.liveDrift (cyclomatic 22) · ×1
  • gitLabTriggerAccountOp.liveDrift (cyclomatic 22) internal/repos/gitlab_trigger_account_status.go:292 — gitLabTriggerAccountOp.liveDrift has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · runtime.piToolsFor (cyclomatic 22) · ×1
  • runtime.piToolsFor (cyclomatic 22) internal/runtime/pi_agent.go:258 — runtime.piToolsFor has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DummyPlaybackRuntime.Run (cyclomatic 22) · ×1
  • DummyPlaybackRuntime.Run (cyclomatic 22) REDACTED:108 — DummyPlaybackRuntime.Run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JiraClient.TransitionIssue (cyclomatic 22) · ×1
  • JiraClient.TransitionIssue (cyclomatic 22) internal/tracker/transition.go:100 — JiraClient.TransitionIssue has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · slotAllocator.reclaimSlot (cyclomatic 22) · ×1
  • slotAllocator.reclaimSlot (cyclomatic 22) pkg/behaviourtest/drivers/install/slotgc.go:477 — slotAllocator.reclaimSlot has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · steps.givenURLSourcedBaseHarness (cyclomatic 22) · ×1
  • steps.givenURLSourcedBaseHarness (cyclomatic 22) pkg/behaviourtest/steps/base_dispatch.go:73 — steps.givenURLSourcedBaseHarness has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · posttool_chain._handle_failure (cyclomatic 22) · ×1
  • posttool_chain._handle_failure (cyclomatic 22) internal/security/hooks/posttool_chain.py:183 — posttool_chain._handle_failure has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.main (cyclomatic 21) · ×1
  • main.main (cyclomatic 21) hack/prove-otlp-scores/main.go:27 — main.main has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runDispatch (cyclomatic 21) · ×1
  • cli.runDispatch (cyclomatic 21) internal/cli/dispatch.go:122 — cli.runDispatch has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.EffectiveYAML (cyclomatic 21) · ×1
  • config.EffectiveYAML (cyclomatic 21) internal/config/effective.go:20 — config.EffectiveYAML has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · perRepoConfig.validateLocalFields (cyclomatic 21) · ×1
  • perRepoConfig.validateLocalFields (cyclomatic 21) internal/config/config.go:1265 — perRepoConfig.validateLocalFields has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · perRepoConfig.AgentEntries (cyclomatic 21) · ×1
  • perRepoConfig.AgentEntries (cyclomatic 21) internal/config/interfaces.go:177 — perRepoConfig.AgentEntries has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · envmanifest.collectFromCommand (cyclomatic 21) · ×1
  • envmanifest.collectFromCommand (cyclomatic 21) internal/envmanifest/shellexports.go:87 — envmanifest.collectFromCommand has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · blobJSONReadCloser.Read (cyclomatic 21) · ×1
  • blobJSONReadCloser.Read (cyclomatic 21) internal/forge/github/blobstream.go:52 — blobJSONReadCloser.Read has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · poll.buildEventPayload (cyclomatic 21) · ×1
  • poll.buildEventPayload (cyclomatic 21) internal/poll/dispatch.go:500 — poll.buildEventPayload has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Poller.applyPersistDeltas (cyclomatic 21) · ×1
  • Poller.applyPersistDeltas (cyclomatic 21) internal/poll/state.go:753 — Poller.applyPersistDeltas has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.preflightGitLabRoleCleanup (cyclomatic 21) · ×1
  • repos.preflightGitLabRoleCleanup (cyclomatic 21) internal/repos/gitlab_roles_cleanup.go:225 — repos.preflightGitLabRoleCleanup has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.triggerVariableOverrideProblemSeen (cyclomatic 21) · ×1
  • repos.triggerVariableOverrideProblemSeen (cyclomatic 21) internal/repos/gitlab_trigger_jobs.go:825 — repos.triggerVariableOverrideProblemSeen has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ConvergeGitLabTriggerSchedules (cyclomatic 21) · ×1
  • repos.ConvergeGitLabTriggerSchedules (cyclomatic 21) internal/repos/gitlab_trigger_schedules.go:100 — repos.ConvergeGitLabTriggerSchedules has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.GitLabWebhookNeedsProvisioning (cyclomatic 21) · ×1
  • repos.GitLabWebhookNeedsProvisioning (cyclomatic 21) internal/repos/gitlab_webhook.go:471 — repos.GitLabWebhookNeedsProvisioning has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabTriggerProjectSafetyProblem (cyclomatic 21) · ×1
  • repos.gitlabTriggerProjectSafetyProblem (cyclomatic 21) internal/repos/gitlab_webhook.go:762 — repos.gitlabTriggerProjectSafetyProblem has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.TeardownGitLabWebhookFastPathLocked (cyclomatic 21) · ×1
  • repos.TeardownGitLabWebhookFastPathLocked (cyclomatic 21) internal/repos/gitlab_webhook.go:2584 — repos.TeardownGitLabWebhookFastPathLocked has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.removeWorkflowRules (cyclomatic 21) · ×1
  • repos.removeWorkflowRules (cyclomatic 21) internal/repos/gitlabci.go:1907 — repos.removeWorkflowRules has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.BuildScaffoldFiles (cyclomatic 21) · ×1
  • repos.BuildScaffoldFiles (cyclomatic 21) internal/repos/install.go:581 — repos.BuildScaffoldFiles has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeJiraPoll (cyclomatic 21) · ×1
  • repos.convergeJiraPoll (cyclomatic 21) internal/repos/jira_poll.go:297 — repos.convergeJiraPoll has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceAccountTokenClient.needsServiceAccountReplacement (cyclomatic 21) · ×1
  • ServiceAccountTokenClient.needsServiceAccountReplacement (cyclomatic 21) internal/repos/gitlab_service_account_converge.go:174 — ServiceAccountTokenClient.needsServiceAccountReplacement has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.containBySinkState (cyclomatic 21) · ×1
  • gitLabTriggerAccountOp.containBySinkState (cyclomatic 21) internal/repos/gitlab_trigger_account.go:1061 — gitLabTriggerAccountOp.containBySinkState has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.countCodexChildRollouts (cyclomatic 21) · ×1
  • runtime.countCodexChildRollouts (cyclomatic 21) internal/runtime/codex_subagents.go:580 — runtime.countCodexChildRollouts has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.staleAgentSnapshot (cyclomatic 21) · ×1
  • runtime.staleAgentSnapshot (cyclomatic 21) internal/runtime/task_progress_reconciler.go:350 — runtime.staleAgentSnapshot has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · progressReconciler.status (cyclomatic 21) · ×1
  • progressReconciler.status (cyclomatic 21) internal/runtime/status_progress.go:15 — progressReconciler.status has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Driver.emptyMatrixPollOnce (cyclomatic 21) · ×1
  • Driver.emptyMatrixPollOnce (cyclomatic 21) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1944 — Driver.emptyMatrixPollOnce has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolve-precommit-tools.merge_registries (cyclomatic 21) · ×1
  • resolve-precommit-tools.merge_registries (cyclomatic 21) internal/scaffold/fullsend-repo/scripts/resolve-precommit-tools.py:42 — resolve-precommit-tools.merge_registries has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · secret_redact_posttool._credential_like (cyclomatic 21) · ×1
  • secret_redact_posttool._credential_like (cyclomatic 21) internal/security/hooks/secret_redact_posttool.py:475 — secret_redact_posttool._credential_like has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · nextwork._format_mutation_line (cyclomatic 21) · ×1
  • nextwork._format_mutation_line (cyclomatic 21) skills/nextwork/scripts/nextwork.py:2503 — nextwork._format_mutation_line has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nextwork.format_markdown_output (cyclomatic 21) · ×1
  • nextwork.format_markdown_output (cyclomatic 21) skills/nextwork/scripts/nextwork.py:2548 — nextwork.format_markdown_output has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nextwork.main (cyclomatic 21) · ×1
  • nextwork.main (cyclomatic 21) skills/nextwork/scripts/nextwork.py:2761 — nextwork.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.bootstrapCommon (cyclomatic 20) · ×1
  • cli.bootstrapCommon (cyclomatic 20) internal/cli/run.go:3420 — cli.bootstrapCommon has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.agentsRepoHostTreeFetcher (cyclomatic 20) · ×1
  • cli.agentsRepoHostTreeFetcher (cyclomatic 20) internal/cli/run.go:8304 — cli.agentsRepoHostTreeFetcher has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 8309). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.reseedCredential (cyclomatic 20) · ×1
  • cli.reseedCredential (cyclomatic 20) internal/cli/run_openai.go:363 — cli.reseedCredential has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · contentCollector.toolArguments (cyclomatic 20) · ×1
  • contentCollector.toolArguments (cyclomatic 20) internal/cli/content_collector.go:968 — contentCollector.toolArguments has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.validateTracking (cyclomatic 20) · ×1
  • config.validateTracking (cyclomatic 20) internal/config/issue_targets.go:481 — config.validateTracking has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AuthorizationProvider.UnmarshalYAML (cyclomatic 20) · ×1
  • AuthorizationProvider.UnmarshalYAML (cyclomatic 20) internal/config/config.go:365 — AuthorizationProvider.UnmarshalYAML has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Provisioner.validate (cyclomatic 20) · ×1
  • Provisioner.validate (cyclomatic 20) internal/dispatch/cf/provisioner.go:460 — Provisioner.validate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gcf.bundleEmbeddedMintSource (cyclomatic 20) · ×1
  • gcf.bundleEmbeddedMintSource (cyclomatic 20) internal/dispatch/gcf/provisioner.go:2095 — gcf.bundleEmbeddedMintSource has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e2etest.CleanupStaleResources (cyclomatic 20) · ×1
  • e2etest.CleanupStaleResources (cyclomatic 20) internal/e2etest/cleanup.go:21 — e2etest.CleanupStaleResources has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.createCommitOnBranch (cyclomatic 20) · ×1
  • LiveClient.createCommitOnBranch (cyclomatic 20) internal/forge/github/commit_graphql.go:94 — LiveClient.createCommitOnBranch has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.ListPullRequestReviewThreads (cyclomatic 20) · ×1
  • LiveClient.ListPullRequestReviewThreads (cyclomatic 20) REDACTED:4527 — LiveClient.ListPullRequestReviewThreads has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TriggerOwner.resolveSuppliedAccounts (cyclomatic 20) · ×1
  • TriggerOwner.resolveSuppliedAccounts (cyclomatic 20) internal/gitlablifecycle/trigger_owner.go:307 — TriggerOwner.resolveSuppliedAccounts has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitlabroles.registrationFromFile (cyclomatic 20) · ×1
  • gitlabroles.registrationFromFile (cyclomatic 20) internal/gitlabroles/registry.go:469 — gitlabroles.registrationFromFile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mintclient.QueryStatus (cyclomatic 20) · ×1
  • mintclient.QueryStatus (cyclomatic 20) internal/mintclient/mintclient.go:503 — mintclient.QueryStatus has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.webhookNoteEvents (cyclomatic 20) · ×1
  • Poller.webhookNoteEvents (cyclomatic 20) internal/poll/webhook.go:244 — Poller.webhookNoteEvents has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.prepareHandoffPollerOwnedTrigger (cyclomatic 20) · ×1
  • repos.prepareHandoffPollerOwnedTrigger (cyclomatic 20) internal/repos/gitlab_poller_cutover.go:39 — repos.prepareHandoffPollerOwnedTrigger has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabDispatchInputContractMatches (cyclomatic 20) · ×1
  • repos.gitlabDispatchInputContractMatches (cyclomatic 20) internal/repos/gitlab_trigger_dispatch_gate.go:549 — repos.gitlabDispatchInputContractMatches has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 550). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · repos.probeGitLabWebhookState (cyclomatic 20) · ×1
  • repos.probeGitLabWebhookState (cyclomatic 20) internal/repos/gitlab_webhook.go:255 — repos.probeGitLabWebhookState has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manifest.validateConfigSource (cyclomatic 20) · ×1
  • Manifest.validateConfigSource (cyclomatic 20) REDACTED:1983 — Manifest.validateConfigSource has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.buildRunCommandWithDigests (cyclomatic 20) · ×1
  • runtime.buildRunCommandWithDigests (cyclomatic 20) internal/runtime/claude.go:813 — runtime.buildRunCommandWithDigests has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scaffold.FindStaleVendoredAssets (cyclomatic 20) · ×1
  • scaffold.FindStaleVendoredAssets (cyclomatic 20) internal/scaffold/vendorcleanup.go:61 — scaffold.FindStaleVendoredAssets has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · statuscomment.ReconcileOrphaned (cyclomatic 20) · ×1
  • statuscomment.ReconcileOrphaned (cyclomatic 20) internal/statuscomment/statuscomment.go:778 — statuscomment.ReconcileOrphaned has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · composedDriver.Finalize (cyclomatic 20) · ×1
  • composedDriver.Finalize (cyclomatic 20) REDACTED:731 — composedDriver.Finalize has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.mintStatusFacts (cyclomatic 20) · ×1
  • steps.mintStatusFacts (cyclomatic 20) pkg/behaviourtest/steps/mint_status.go:504 — steps.mintStatusFacts has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fullsend-codex-hook.run_script (cyclomatic 20) · ×1
  • fullsend-codex-hook.run_script (cyclomatic 20) internal/runtime/codex_hook/fullsend-codex-hook.py:505 — fullsend-codex-hook.run_script has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · secret_redact_posttool.content_skips (cyclomatic 20) · ×1
  • secret_redact_posttool.content_skips (cyclomatic 20) internal/security/hooks/secret_redact_posttool.py:177 — secret_redact_posttool.content_skips has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · adr_corner.discussion_points (cyclomatic 20) · ×1
  • adr_corner.discussion_points (cyclomatic 20) skills/adr-corner/scripts/adr_corner.py:329 — adr_corner.discussion_points has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · artifacts.stripRecord (cyclomatic 19) · ×1
  • artifacts.stripRecord (cyclomatic 19) internal/artifacts/telemetry.go:83 — artifacts.stripRecord has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runAgentNew (cyclomatic 19) · ×1
  • cli.runAgentNew (cyclomatic 19) internal/cli/agent_new.go:246 — cli.runAgentNew has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runMintUnenrollRepo (cyclomatic 19) · ×1
  • cli.runMintUnenrollRepo (cyclomatic 19) internal/cli/mint.go:1542 — cli.runMintUnenrollRepo has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runMintDeleteCloudflare (cyclomatic 19) · ×1
  • cli.runMintDeleteCloudflare (cyclomatic 19) internal/cli/mint_delete.go:249 — cli.runMintDeleteCloudflare has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.forgePointerAttrs (cyclomatic 19) · ×1
  • cli.forgePointerAttrs (cyclomatic 19) internal/cli/run_forge_attrs.go:33 — cli.forgePointerAttrs has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runJiraRefresh (cyclomatic 19) · ×1
  • cli.runJiraRefresh (cyclomatic 19) internal/cli/run_jira.go:678 — cli.runJiraRefresh has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Provisioner.provisionWithExistingMint (cyclomatic 19) · ×1
  • Provisioner.provisionWithExistingMint (cyclomatic 19) internal/dispatch/gcf/provisioner.go:756 — Provisioner.provisionWithExistingMint has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evalmeasure.ScoreFitnessNamed (cyclomatic 19) · ×1
  • evalmeasure.ScoreFitnessNamed (cyclomatic 19) internal/evalmeasure/fitness.go:24 — evalmeasure.ScoreFitnessNamed has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evalmeasure.ScoreRunHealthNamed (cyclomatic 19) · ×1
  • evalmeasure.ScoreRunHealthNamed (cyclomatic 19) internal/evalmeasure/runhealth.go:41 — evalmeasure.ScoreRunHealthNamed has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.updateOrDeleteNote (cyclomatic 19) · ×1
  • LiveClient.updateOrDeleteNote (cyclomatic 19) internal/forge/gitlab/issue.go:419 — LiveClient.updateOrDeleteNote has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jira.convertBlockNode (cyclomatic 19) · ×1
  • jira.convertBlockNode (cyclomatic 19) internal/forge/jira/adf.go:340 — jira.convertBlockNode has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.fetchBaseSkill (cyclomatic 19) · ×1
  • harness.fetchBaseSkill (cyclomatic 19) internal/harness/compose.go:2184 — harness.fetchBaseSkill has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.mergeForgeConfigInto (cyclomatic 19) · ×1
  • harness.mergeForgeConfigInto (cyclomatic 19) internal/harness/compose.go:2842 — harness.mergeForgeConfigInto has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · input.mapIssueCommentEvent (cyclomatic 19) · ×1
  • input.mapIssueCommentEvent (cyclomatic 19) internal/harnessdispatch/input/ghaevent.go:269 — input.mapIssueCommentEvent has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.finalizePendingPollerCutover (cyclomatic 19) · ×1
  • repos.finalizePendingPollerCutover (cyclomatic 19) internal/repos/gitlab_poller_cutover.go:252 — repos.finalizePendingPollerCutover has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabDispatchConsumerProblem (cyclomatic 19) · ×1
  • repos.gitlabDispatchConsumerProblem (cyclomatic 19) internal/repos/gitlab_trigger_consumer.go:53 — repos.gitlabDispatchConsumerProblem has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.jobExecSurfaceProblem (cyclomatic 19) · ×1
  • repos.jobExecSurfaceProblem (cyclomatic 19) internal/repos/gitlab_trigger_jobs.go:435 — repos.jobExecSurfaceProblem has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.unevaluableRuleReason (cyclomatic 19) · ×1
  • repos.unevaluableRuleReason (cyclomatic 19) internal/repos/gitlab_workflow_admission.go:404 — repos.unevaluableRuleReason has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.mergeGitLabCIWithWrapper (cyclomatic 19) · ×1
  • repos.mergeGitLabCIWithWrapper (cyclomatic 19) internal/repos/gitlabci.go:554 — repos.mergeGitLabCIWithWrapper has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.validateManifestManaged (cyclomatic 19) · ×1
  • repos.validateManifestManaged (cyclomatic 19) internal/repos/managed_config.go:306 — repos.validateManifestManaged has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.flattenMergeKeys (cyclomatic 19) · ×1
  • repos.flattenMergeKeys (cyclomatic 19) internal/repos/manifest_legacy_tracking.go:235 — repos.flattenMergeKeys has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.openAIWIFVariableIdentifiers (cyclomatic 19) · ×1
  • repos.openAIWIFVariableIdentifiers (cyclomatic 19) internal/repos/openai_wif.go:103 — repos.openAIWIFVariableIdentifiers has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manifest.ExpandGlobsFor (cyclomatic 19) · ×1
  • Manifest.ExpandGlobsFor (cyclomatic 19) REDACTED:1099 — Manifest.ExpandGlobsFor has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResolvedConfig.applyEffectiveInfrastructure (cyclomatic 19) · ×1
  • ResolvedConfig.applyEffectiveInfrastructure (cyclomatic 19) internal/repos/infrastructure.go:81 — ResolvedConfig.applyEffectiveInfrastructure has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · manifestEditor.prepareSplice (cyclomatic 19) · ×1
  • manifestEditor.prepareSplice (cyclomatic 19) internal/repos/manifest_set.go:1352 — manifestEditor.prepareSplice has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.taskProgressMessage (cyclomatic 19) · ×1
  • runtime.taskProgressMessage (cyclomatic 19) internal/runtime/task_progress_message.go:6 — runtime.taskProgressMessage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tokenBasedAnnotation.tokenAnnotation (cyclomatic 19) · ×1
  • tokenBasedAnnotation.tokenAnnotation (cyclomatic 19) internal/sentencetoken/annotate.go:55 — tokenBasedAnnotation.tokenAnnotation has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Notifier.PostCompletionWithDetail (cyclomatic 19) · ×1
  • Notifier.PostCompletionWithDetail (cyclomatic 19) internal/statuscomment/statuscomment.go:347 — Notifier.PostCompletionWithDetail has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Envelope.validate (cyclomatic 19) · ×1
  • Envelope.validate (cyclomatic 19) internal/telemetry/tracecontext/envelope.go:129 — Envelope.validate has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tracker.transitionFields (cyclomatic 19) · ×1
  • tracker.transitionFields (cyclomatic 19) internal/tracker/transition.go:156 — tracker.transitionFields has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behaviourtest.RunSuite (cyclomatic 19) · ×1
  • behaviourtest.RunSuite (cyclomatic 19) pkg/behaviourtest/run.go:41 — behaviourtest.RunSuite has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.commitLocalHarnessResources (cyclomatic 19) · ×1
  • steps.commitLocalHarnessResources (cyclomatic 19) pkg/behaviourtest/steps/dispatch.go:339 — steps.commitLocalHarnessResources has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mintcore.NewHandler (cyclomatic 19) · ×1
  • mintcore.NewHandler (cyclomatic 19) internal/mintcore/handler.go:119 — mintcore.NewHandler has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mintcore.parseTraceparent (cyclomatic 19) · ×1
  • mintcore.parseTraceparent (cyclomatic 19) internal/mintcore/tracing.go:298 — mintcore.parseTraceparent has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · secret_redact_posttool.structural_secrets (cyclomatic 19) · ×1
  • secret_redact_posttool.structural_secrets (cyclomatic 19) internal/security/hooks/secret_redact_posttool.py:553 — secret_redact_posttool.structural_secrets has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.bindGitLabCredentialToForgeHost (cyclomatic 18) · ×1
  • cli.bindGitLabCredentialToForgeHost (cyclomatic 18) internal/cli/gitlab_profile.go:179 — cli.bindGitLabCredentialToForgeHost has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.checkGitLabCredentialBinding (cyclomatic 18) · ×1
  • cli.checkGitLabCredentialBinding (cyclomatic 18) internal/cli/gitlab_profile.go:529 — cli.checkGitLabCredentialBinding has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runIssuesGet (cyclomatic 18) · ×1
  • cli.runIssuesGet (cyclomatic 18) internal/cli/issues.go:140 — cli.runIssuesGet has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runMintDeleteGCP (cyclomatic 18) · ×1
  • cli.runMintDeleteGCP (cyclomatic 18) internal/cli/mint_delete.go:118 — cli.runMintDeleteGCP has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.newPostReviewCmd (cyclomatic 18) · ×1
  • cli.newPostReviewCmd (cyclomatic 18) REDACTED:71 — cli.newPostReviewCmd has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 114). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.sanitizeReviewResult (cyclomatic 18) · ×1
  • cli.sanitizeReviewResult (cyclomatic 18) REDACTED:949 — cli.sanitizeReviewResult has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.newGitLabRoleTokenClient (cyclomatic 18) · ×1
  • cli.newGitLabRoleTokenClient (cyclomatic 18) internal/cli/repos_gitlab_service_accounts.go:38 — cli.newGitLabRoleTokenClient has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 142, 42, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.fetchPinnedAgentsRepoFile (cyclomatic 18) · ×1
  • cli.fetchPinnedAgentsRepoFile (cyclomatic 18) internal/cli/run.go:8017 — cli.fetchPinnedAgentsRepoFile has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.validateGatewayHost (cyclomatic 18) · ×1
  • cli.validateGatewayHost (cyclomatic 18) internal/cli/run_gateway_egress.go:50 — cli.validateGatewayHost has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.trustedTirithRepoPolicy (cyclomatic 18) · ×1
  • cli.trustedTirithRepoPolicy (cyclomatic 18) internal/cli/tirith_repo_policy.go:117 — cli.trustedTirithRepoPolicy has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Provisioner.provisionRepoWIFProvider (cyclomatic 18) · ×1
  • Provisioner.provisionRepoWIFProvider (cyclomatic 18) internal/dispatch/gcf/provisioner.go:1527 — Provisioner.provisionRepoWIFProvider has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LiveClient.doAttempts (cyclomatic 18) · ×1
  • LiveClient.doAttempts (cyclomatic 18) internal/forge/gitlab/gitlab.go:193 — LiveClient.doAttempts has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Client.DoRequest (cyclomatic 18) · ×1
  • Client.DoRequest (cyclomatic 18) internal/gcp/client.go:130 — Client.DoRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UninstallTokenClient.ReconcileGitLabPollersForUninstall (cyclomatic 18) · ×1
  • UninstallTokenClient.ReconcileGitLabPollersForUninstall (cyclomatic 18) internal/gitlablifecycle/uninstall.go:122 — UninstallTokenClient.ReconcileGitLabPollersForUninstall has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Poller.webhookMergeRequestEvent (cyclomatic 18) · ×1
  • Poller.webhookMergeRequestEvent (cyclomatic 18) internal/poll/webhook.go:341 — Poller.webhookMergeRequestEvent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.webhookIssueEvents (cyclomatic 18) · ×1
  • Poller.webhookIssueEvents (cyclomatic 18) internal/poll/webhook.go:418 — Poller.webhookIssueEvents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.convergeGitLabRootCIFiles (cyclomatic 18) · ×1
  • repos.convergeGitLabRootCIFiles (cyclomatic 18) internal/repos/converge.go:2853 — repos.convergeGitLabRootCIFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.checkGitHubJiraPollWorkflow (cyclomatic 18) · ×1
  • repos.checkGitHubJiraPollWorkflow (cyclomatic 18) internal/repos/github_jira_poll.go:36 — repos.checkGitHubJiraPollWorkflow has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.revokeRetiringPollerTriggers (cyclomatic 18) · ×1
  • repos.revokeRetiringPollerTriggers (cyclomatic 18) internal/repos/gitlab_poller_retirement.go:219 — repos.revokeRetiringPollerTriggers has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.cleanupOutgoing (cyclomatic 18) · ×1
  • repos.cleanupOutgoing (cyclomatic 18) internal/repos/gitlab_roles_rotate.go:1233 — repos.cleanupOutgoing 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. This is NOT this file's highest cyclomatic complexity: repos.initialDistributionEligible (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · repos.suppliedAwareInventory (cyclomatic 18) · ×1
  • repos.suppliedAwareInventory (cyclomatic 18) internal/repos/gitlab_roles_rotate.go:1901 — repos.suppliedAwareInventory 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. This is NOT this file's highest cyclomatic complexity: repos.initialDistributionEligible (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · repos.RotateGitLabTriggerAccount (cyclomatic 18) · ×1
  • repos.RotateGitLabTriggerAccount (cyclomatic 18) internal/repos/gitlab_trigger_account.go:2209 — repos.RotateGitLabTriggerAccount has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabIncludeAdmits (cyclomatic 18) · ×1
  • repos.gitlabIncludeAdmits (cyclomatic 18) internal/repos/gitlab_trigger_consumer.go:246 — repos.gitlabIncludeAdmits has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.CheckGitLabTriggerDispatchGate (cyclomatic 18) · ×1
  • repos.CheckGitLabTriggerDispatchGate (cyclomatic 18) internal/repos/gitlab_trigger_dispatch_gate.go:114 — repos.CheckGitLabTriggerDispatchGate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.evaluateRules (cyclomatic 18) · ×1
  • repos.evaluateRules (cyclomatic 18) internal/repos/gitlab_workflow_admission.go:326 — repos.evaluateRules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabRootDeclaresDispatchInputs (cyclomatic 18) · ×1
  • repos.gitlabRootDeclaresDispatchInputs (cyclomatic 18) internal/repos/gitlabci.go:800 — repos.gitlabRootDeclaresDispatchInputs has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.parseManifestPath (cyclomatic 18) · ×1
  • repos.parseManifestPath (cyclomatic 18) internal/repos/manifest_set.go:394 — repos.parseManifestPath has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.checkForgeFields (cyclomatic 18) · ×1
  • repos.checkForgeFields (cyclomatic 18) internal/repos/manifest_set.go:582 — repos.checkForgeFields has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ProbeRepoState (cyclomatic 18) · ×1
  • repos.ProbeRepoState (cyclomatic 18) internal/repos/status.go:30 — repos.ProbeRepoState has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.Uninstall (cyclomatic 18) · ×1
  • repos.Uninstall (cyclomatic 18) internal/repos/uninstall.go:231 — repos.Uninstall has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.scheduleOwnershipDrift (cyclomatic 18) · ×1
  • gitLabTriggerAccountOp.scheduleOwnershipDrift (cyclomatic 18) internal/repos/gitlab_trigger_account_status.go:224 — gitLabTriggerAccountOp.scheduleOwnershipDrift has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolve.resolveFileURL (cyclomatic 18) · ×1
  • resolve.resolveFileURL (cyclomatic 18) internal/resolve/resolve.go:567 — resolve.resolveFileURL has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.codexTOMLBasicString (cyclomatic 18) · ×1
  • runtime.codexTOMLBasicString (cyclomatic 18) internal/runtime/codex_config.go:300 — runtime.codexTOMLBasicString has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.discoverPersonas (cyclomatic 18) · ×1
  • runtime.discoverPersonas (cyclomatic 18) internal/runtime/pi_personas.go:92 — runtime.discoverPersonas has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeRuntime.Bootstrap (cyclomatic 18) · ×1
  • ClaudeRuntime.Bootstrap (cyclomatic 18) internal/runtime/claude.go:98 — ClaudeRuntime.Bootstrap has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CodexRuntime.foldCodexChildUsage (cyclomatic 18) · ×1
  • CodexRuntime.foldCodexChildUsage (cyclomatic 18) internal/runtime/codex_subagents.go:364 — CodexRuntime.foldCodexChildUsage has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenCodeRuntime.Bootstrap (cyclomatic 18) · ×1
  • OpenCodeRuntime.Bootstrap (cyclomatic 18) internal/runtime/opencode_bootstrap.go:65 — OpenCodeRuntime.Bootstrap has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PiRuntime.piAgentManifestFor (cyclomatic 18) · ×1
  • PiRuntime.piAgentManifestFor (cyclomatic 18) internal/runtime/pi_bootstrap.go:534 — PiRuntime.piAgentManifestFor has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · githubactions.extractArtifactZip (cyclomatic 18) · ×1
  • githubactions.extractArtifactZip (cyclomatic 18) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:586 — githubactions.extractArtifactZip has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitlabci.extractArtifactZip (cyclomatic 18) · ×1
  • gitlabci.extractArtifactZip (cyclomatic 18) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:919 — gitlabci.extractArtifactZip has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.WaitForWorkflow (cyclomatic 18) · ×1
  • Driver.WaitForWorkflow (cyclomatic 18) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:147 — Driver.WaitForWorkflow has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.classifyBotRoleResult (cyclomatic 18) · ×1
  • steps.classifyBotRoleResult (cyclomatic 18) pkg/behaviourtest/steps/bot_role_probe.go:434 — steps.classifyBotRoleResult has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps.collectScenarioRunLogs (cyclomatic 18) · ×1
  • steps.collectScenarioRunLogs (cyclomatic 18) pkg/behaviourtest/steps/debuglogs.go:612 — steps.collectScenarioRunLogs has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.givenIssueFromFixture (cyclomatic 18) · ×1
  • steps.givenIssueFromFixture (cyclomatic 18) pkg/behaviourtest/steps/playback.go:88 — steps.givenIssueFromFixture has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · mintcore.NewTracer (cyclomatic 18) · ×1
  • mintcore.NewTracer (cyclomatic 18) internal/mintcore/tracing.go:140 — mintcore.NewTracer has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JWKSVerifier.Verify (cyclomatic 18) · ×1
  • JWKSVerifier.Verify (cyclomatic 18) internal/mintcore/jwks_verifier.go:90 — JWKSVerifier.Verify has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ssrf_pretool._has_command_substitution (cyclomatic 18) · ×1
  • ssrf_pretool._has_command_substitution (cyclomatic 18) internal/security/hooks/ssrf_pretool.py:812 — ssrf_pretool._has_command_substitution has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runAgentUpdate (cyclomatic 17) · ×1
  • cli.runAgentUpdate (cyclomatic 17) internal/cli/agent.go:512 — cli.runAgentUpdate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.runAgentRemove (cyclomatic 17) · ×1
  • cli.runAgentRemove (cyclomatic 17) internal/cli/agent.go:721 — cli.runAgentRemove has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.newForeignListCmd (cyclomatic 17) · ×1
  • cli.newForeignListCmd (cyclomatic 17) internal/cli/foreign.go:121 — cli.newForeignListCmd has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 127). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.newForeignRevokeCmd (cyclomatic 17) · ×1
  • cli.newForeignRevokeCmd (cyclomatic 17) internal/cli/foreign.go:266 — cli.newForeignRevokeCmd has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 271). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.newMintDeployCmd (cyclomatic 17) · ×1
  • cli.newMintDeployCmd (cyclomatic 17) internal/cli/mint.go:418 — cli.newMintDeployCmd has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 591). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.annotateGitLabRoleLifecycle (cyclomatic 17) · ×1
  • cli.annotateGitLabRoleLifecycle (cyclomatic 17) internal/cli/repos_gitlab.go:169 — cli.annotateGitLabRoleLifecycle has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.verifyGitLabRoleToken (cyclomatic 17) · ×1
  • cli.verifyGitLabRoleToken (cyclomatic 17) internal/cli/repos_gitlab_service_accounts.go:195 — cli.verifyGitLabRoleToken has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.maskSecretLiterals (cyclomatic 17) · ×1
  • cli.maskSecretLiterals (cyclomatic 17) internal/cli/run.go:4787 — cli.maskSecretLiterals has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.runOpenAIRefresh (cyclomatic 17) · ×1
  • cli.runOpenAIRefresh (cyclomatic 17) internal/cli/run_openai.go:1151 — cli.runOpenAIRefresh has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.loadRunnerSecrets (cyclomatic 17) · ×1
  • cli.loadRunnerSecrets (cyclomatic 17) internal/cli/runner_secrets.go:146 — cli.loadRunnerSecrets has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.newScanInputCmd (cyclomatic 17) · ×1
  • cli.newScanInputCmd (cyclomatic 17) REDACTED:55 — cli.newScanInputCmd has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 65). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LiveGCFClient.GetServiceTrafficEnvVars (cyclomatic 17) · ×1
  • LiveGCFClient.GetServiceTrafficEnvVars (cyclomatic 17) internal/dispatch/gcf/gcp.go:1700 — LiveGCFClient.GetServiceTrafficEnvVars has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · envfile.Load (cyclomatic 17) · ×1
  • envfile.Load (cyclomatic 17) internal/envfile/envfile.go:33 — envfile.Load has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.pullRequestFileModes (cyclomatic 17) · ×1
  • LiveClient.pullRequestFileModes (cyclomatic 17) REDACTED:4266 — LiveClient.pullRequestFileModes has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.ListPullRequestFileDiffs (cyclomatic 17) · ×1
  • LiveClient.ListPullRequestFileDiffs (cyclomatic 17) internal/forge/gitlab/mr.go:345 — LiveClient.ListPullRequestFileDiffs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · LiveClient.resolveRootCommitSHA (cyclomatic 17) · ×1
  • LiveClient.resolveRootCommitSHA (cyclomatic 17) REDACTED:1069 — LiveClient.resolveRootCommitSHA has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jira.walkInline (cyclomatic 17) · ×1
  • jira.walkInline (cyclomatic 17) internal/forge/jira/adf.go:582 — jira.walkInline has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TriggerOwner.PollerUserID (cyclomatic 17) · ×1
  • TriggerOwner.PollerUserID (cyclomatic 17) internal/gitlablifecycle/trigger_owner.go:71 — TriggerOwner.PollerUserID has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Registry.add (cyclomatic 17) · ×1
  • Registry.add (cyclomatic 17) internal/gitlabroles/registry.go:373 — Registry.add has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harness.fetchBaseScriptDirTree (cyclomatic 17) · ×1
  • harness.fetchBaseScriptDirTree (cyclomatic 17) internal/harness/compose.go:2094 — harness.fetchBaseScriptDirTree has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · harness.mergeForgeConfig (cyclomatic 17) · ×1
  • harness.mergeForgeConfig (cyclomatic 17) internal/harness/forge.go:377 — harness.mergeForgeConfig has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Harness.Lint (cyclomatic 17) · ×1
  • Harness.Lint (cyclomatic 17) internal/harness/lint.go:85 — Harness.Lint has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.resolveEventRoles (cyclomatic 17) · ×1
  • Poller.resolveEventRoles (cyclomatic 17) internal/jirapoll/auth.go:129 — Poller.resolveEventRoles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · layers.checkUnsyncedForkFallback (cyclomatic 17) · ×1
  • layers.checkUnsyncedForkFallback (cyclomatic 17) internal/layers/commit.go:518 — layers.checkUnsyncedForkFallback has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Poller.dispatch (cyclomatic 17) · ×1
  • Poller.dispatch (cyclomatic 17) internal/poll/dispatch.go:56 — Poller.dispatch has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · prescript.ParseFile (cyclomatic 17) · ×1
  • prescript.ParseFile (cyclomatic 17) internal/prescript/prescript.go:133 — prescript.ParseFile has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.checkPresetDrift (cyclomatic 17) · ×1
  • repos.checkPresetDrift (cyclomatic 17) internal/repos/config_preset.go:244 — repos.checkPresetDrift has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.revokeGitLabIdentityTokensSkipping (cyclomatic 17) · ×1
  • repos.revokeGitLabIdentityTokensSkipping (cyclomatic 17) internal/repos/gitlab_roles_cleanup.go:559 — repos.revokeGitLabIdentityTokensSkipping has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.revokeUnsafeTriggerCredential (cyclomatic 17) · ×1
  • repos.revokeUnsafeTriggerCredential (cyclomatic 17) internal/repos/gitlab_webhook.go:1093 — repos.revokeUnsafeTriggerCredential has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabWrapperForwardsDispatchInputs (cyclomatic 17) · ×1
  • repos.gitlabWrapperForwardsDispatchInputs (cyclomatic 17) internal/repos/gitlabci.go:1025 — repos.gitlabWrapperForwardsDispatchInputs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.validateJiraPollInputs (cyclomatic 17) · ×1
  • repos.validateJiraPollInputs (cyclomatic 17) internal/repos/jira_poll.go:205 — repos.validateJiraPollInputs has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.rejectRemovedConfigSiblings (cyclomatic 17) · ×1
  • repos.rejectRemovedConfigSiblings (cyclomatic 17) REDACTED:427 — repos.rejectRemovedConfigSiblings has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · repos.hasNullStringElement (cyclomatic 17) · ×1
  • repos.hasNullStringElement (cyclomatic 17) internal/repos/manifest_set.go:805 — repos.hasNullStringElement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.openAIWIFWorkflowProblem (cyclomatic 17) · ×1
  • repos.openAIWIFWorkflowProblem (cyclomatic 17) internal/repos/openai_wif.go:573 — repos.openAIWIFWorkflowProblem has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.extractRawContext (cyclomatic 17) · ×1
  • runtime.extractRawContext (cyclomatic 17) internal/runtime/claude_progress.go:720 — runtime.extractRawContext has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeRuntime.Run (cyclomatic 17) · ×1
  • ClaudeRuntime.Run (cyclomatic 17) internal/runtime/claude.go:391 — ClaudeRuntime.Run has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SecretRedactor.Scan (cyclomatic 17) · ×1
  • SecretRedactor.Scan (cyclomatic 17) internal/security/redactor.go:89 — SecretRedactor.Scan has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SSRFValidator.ValidateURL (cyclomatic 17) · ×1
  • SSRFValidator.ValidateURL (cyclomatic 17) internal/security/ssrf.go:119 — SSRFValidator.ValidateURL has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sticky.BuildUpdatedBody (cyclomatic 17) · ×1
  • sticky.BuildUpdatedBody (cyclomatic 17) internal/sticky/sticky.go:222 — sticky.BuildUpdatedBody has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tracecontext.Admit (cyclomatic 17) · ×1
  • tracecontext.Admit (cyclomatic 17) internal/telemetry/tracecontext/envelope.go:478 — tracecontext.Admit has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Driver.WaitForWorkflow (cyclomatic 17) · ×1
  • Driver.WaitForWorkflow (cyclomatic 17) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:121 — Driver.WaitForWorkflow has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.harnessRoundPollOnce (cyclomatic 17) · ×1
  • Driver.harnessRoundPollOnce (cyclomatic 17) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1431 — Driver.harnessRoundPollOnce has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · traceCollector.Start (cyclomatic 17) · ×1
  • traceCollector.Start (cyclomatic 17) REDACTED:351 — traceCollector.Start has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · traceCollector.stop (cyclomatic 17) · ×1
  • traceCollector.stop (cyclomatic 17) REDACTED:614 — traceCollector.stop has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.ensureRunArtifacts (cyclomatic 17) · ×1
  • steps.ensureRunArtifacts (cyclomatic 17) pkg/behaviourtest/steps/artifacts.go:57 — steps.ensureRunArtifacts has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps.whenMintProbeRequests (cyclomatic 17) · ×1
  • steps.whenMintProbeRequests (cyclomatic 17) pkg/behaviourtest/steps/mint_probe.go:369 — steps.whenMintProbeRequests has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · steps.givenRepositoryAgentSettings (cyclomatic 17) · ×1
  • steps.givenRepositoryAgentSettings (cyclomatic 17) pkg/behaviourtest/steps/runtime.go:204 — steps.givenRepositoryAgentSettings has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mintcore.ParseCustomRolePermissions (cyclomatic 17) · ×1
  • mintcore.ParseCustomRolePermissions (cyclomatic 17) internal/mintcore/github.go:278 — mintcore.ParseCustomRolePermissions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ssrf_pretool.validate_url (cyclomatic 17) · ×1
  • ssrf_pretool.validate_url (cyclomatic 17) internal/security/hooks/ssrf_pretool.py:462 — ssrf_pretool.validate_url has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · adr_corner.infer_adr_authors (cyclomatic 17) · ×1
  • adr_corner.infer_adr_authors (cyclomatic 17) skills/adr-corner/scripts/adr_corner.py:269 — adr_corner.infer_adr_authors has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Options.Validate (cyclomatic 16) · ×1
  • Options.Validate (cyclomatic 16) internal/agentnew/options.go:50 — Options.Validate has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · artifacts.prepareMetadata (cyclomatic 16) · ×1
  • artifacts.prepareMetadata (cyclomatic 16) internal/artifacts/prepare.go:206 — artifacts.prepareMetadata has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runAgentList (cyclomatic 16) · ×1
  • cli.runAgentList (cyclomatic 16) internal/cli/agent.go:452 — cli.runAgentList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.pinAgentURL (cyclomatic 16) · ×1
  • cli.pinAgentURL (cyclomatic 16) internal/cli/agent.go:817 — cli.pinAgentURL has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.evalMeasureFetchContext (cyclomatic 16) · ×1
  • cli.evalMeasureFetchContext (cyclomatic 16) internal/cli/evalmeasure.go:207 — cli.evalMeasureFetchContext has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.validateForgeDestination (cyclomatic 16) · ×1
  • cli.validateForgeDestination (cyclomatic 16) internal/cli/gitlab_profile.go:255 — cli.validateForgeDestination has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.newInferenceProvisionCmd (cyclomatic 16) · ×1
  • cli.newInferenceProvisionCmd (cyclomatic 16) internal/cli/inference.go:67 — cli.newInferenceProvisionCmd has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 111). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cli.postReviewContent (cyclomatic 16) · ×1
  • cli.postReviewContent (cyclomatic 16) REDACTED:368 — cli.postReviewContent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.convergeGitLabDispatchRoute (cyclomatic 16) · ×1
  • cli.convergeGitLabDispatchRoute (cyclomatic 16) internal/cli/repos_gitlab_trigger_account.go:168 — cli.convergeGitLabDispatchRoute has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.planGatewayRoute (cyclomatic 16) · ×1
  • cli.planGatewayRoute (cyclomatic 16) internal/cli/run_gateway_route.go:92 — cli.planGatewayRoute has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Provisioner.ProvisionGitLabWIF (cyclomatic 16) · ×1
  • Provisioner.ProvisionGitLabWIF (cyclomatic 16) internal/dispatch/gcf/gitlab_wif.go:178 — Provisioner.ProvisionGitLabWIF has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evalmeasure.MeasureAndExport (cyclomatic 16) · ×1
  • evalmeasure.MeasureAndExport (cyclomatic 16) internal/evalmeasure/run.go:38 — evalmeasure.MeasureAndExport has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fetch.CacheFindNewest (cyclomatic 16) · ×1
  • fetch.CacheFindNewest (cyclomatic 16) internal/fetch/cache.go:165 — fetch.CacheFindNewest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveClient.ListPullRequestFileDiffs (cyclomatic 16) · ×1
  • LiveClient.ListPullRequestFileDiffs (cyclomatic 16) REDACTED:4362 — LiveClient.ListPullRequestFileDiffs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · harnessdispatch.authorizeEvent (cyclomatic 16) · ×1
  • harnessdispatch.authorizeEvent (cyclomatic 16) internal/harnessdispatch/auth.go:54 — harnessdispatch.authorizeEvent has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Poller.processIssue (cyclomatic 16) · ×1
  • Poller.processIssue (cyclomatic 16) internal/jirapoll/poller.go:468 — Poller.processIssue has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · layers.commitScaffoldViaPR (cyclomatic 16) · ×1
  • layers.commitScaffoldViaPR (cyclomatic 16) internal/layers/commit.go:85 — layers.commitScaffoldViaPR has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.VerifyGitLabPollerCredentials (cyclomatic 16) · ×1
  • repos.VerifyGitLabPollerCredentials (cyclomatic 16) internal/repos/gitlab_poller_credential_policy.go:37 — repos.VerifyGitLabPollerCredentials has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.rotateProvided (cyclomatic 16) · ×1
  • repos.rotateProvided (cyclomatic 16) internal/repos/gitlab_roles_rotate.go:1055 — repos.rotateProvided has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: repos.initialDistributionEligible (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · repos.loadRotationState (cyclomatic 16) · ×1
  • repos.loadRotationState (cyclomatic 16) internal/repos/gitlab_roles_rotate.go:1445 — repos.loadRotationState 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. This is NOT this file's highest cyclomatic complexity: repos.initialDistributionEligible (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · repos.gitlabManagedSourceAdmissionProblem (cyclomatic 16) · ×1
  • repos.gitlabManagedSourceAdmissionProblem (cyclomatic 16) internal/repos/gitlab_trigger_dispatch_gate.go:454 — repos.gitlabManagedSourceAdmissionProblem has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.expandRuleReferences (cyclomatic 16) · ×1
  • repos.expandRuleReferences (cyclomatic 16) internal/repos/gitlab_trigger_job_templates.go:202 — repos.expandRuleReferences has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.globalExecProblem (cyclomatic 16) · ×1
  • repos.globalExecProblem (cyclomatic 16) internal/repos/gitlab_trigger_jobs.go:348 — repos.globalExecProblem has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · repos.gitlabTriggerOwnerProblemSkipping (cyclomatic 16) · ×1
  • repos.gitlabTriggerOwnerProblemSkipping (cyclomatic 16) internal/repos/gitlab_webhook.go:997 — repos.gitlabTriggerOwnerProblemSkipping has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.gitlabWrapperDispatcherProblem (cyclomatic 16) · ×1
  • repos.gitlabWrapperDispatcherProblem (cyclomatic 16) internal/repos/gitlab_webhook.go:1373 — repos.gitlabWrapperDispatcherProblem has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · repos.GitLabWebhookUsesRetiredTriggerCredential (cyclomatic 16) · ×1
  • repos.GitLabWebhookUsesRetiredTriggerCredential (cyclomatic 16) internal/repos/gitlab_webhook_trigger_account.go:145 — repos.GitLabWebhookUsesRetiredTriggerCredential has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.GitLabWebhookTriggerRouteStale (cyclomatic 16) · ×1
  • repos.GitLabWebhookTriggerRouteStale (cyclomatic 16) internal/repos/gitlab_webhook_trigger_account.go:410 — repos.GitLabWebhookTriggerRouteStale has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.ExpectedScaffoldContent (cyclomatic 16) · ×1
  • repos.ExpectedScaffoldContent (cyclomatic 16) internal/repos/install.go:521 — repos.ExpectedScaffoldContent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.checkManagedConfigDrift (cyclomatic 16) · ×1
  • repos.checkManagedConfigDrift (cyclomatic 16) internal/repos/managed_config_lifecycle.go:205 — repos.checkManagedConfigDrift has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.resolveManifestTarget (cyclomatic 16) · ×1
  • repos.resolveManifestTarget (cyclomatic 16) internal/repos/manifest_set.go:278 — repos.resolveManifestTarget has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repos.Status (cyclomatic 16) · ×1
  • repos.Status (cyclomatic 16) internal/repos/status.go:186 — repos.Status has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · suppliedPollerGrantProbe.rollback (cyclomatic 16) · ×1
  • suppliedPollerGrantProbe.rollback (cyclomatic 16) internal/repos/gitlab_supplied_provenance.go:526 — suppliedPollerGrantProbe.rollback has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gitLabTriggerAccountOp.bootstrap (cyclomatic 16) · ×1
  • gitLabTriggerAccountOp.bootstrap (cyclomatic 16) internal/repos/gitlab_trigger_account.go:1706 — gitLabTriggerAccountOp.bootstrap has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scaffold.isFullsendOwnedVendoredPath (cyclomatic 16) · ×1
  • scaffold.isFullsendOwnedVendoredPath (cyclomatic 16) internal/scaffold/vendorcleanup.go:177 — scaffold.isFullsendOwnedVendoredPath has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · artifacts.FindOutputFilesByArtifact (cyclomatic 16) · ×1
  • artifacts.FindOutputFilesByArtifact (cyclomatic 16) pkg/behaviourtest/artifacts/find.go:43 — artifacts.FindOutputFilesByArtifact 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 2 function literals inside it that branch (lines 49, 90). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Driver.harnessPollOnce (cyclomatic 16) · ×1
  • Driver.harnessPollOnce (cyclomatic 16) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1281 — Driver.harnessPollOnce has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.hasSupersedingAgentRun (cyclomatic 16) · ×1
  • Driver.hasSupersedingAgentRun (cyclomatic 16) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1584 — Driver.hasSupersedingAgentRun has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.harnessRoundPollOnce (cyclomatic 16) · ×1
  • Driver.harnessRoundPollOnce (cyclomatic 16) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:570 — Driver.harnessRoundPollOnce has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.failedHarnessPollOnce (cyclomatic 16) · ×1
  • Driver.failedHarnessPollOnce (cyclomatic 16) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:680 — Driver.failedHarnessPollOnce has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · retryselect.scenarioLines (cyclomatic 16) · ×1
  • retryselect.scenarioLines (cyclomatic 16) pkg/behaviourtest/retryselect/retryselect.go:161 — retryselect.scenarioLines has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · steps.collectDispatchDiagnostics (cyclomatic 16) · ×1
  • steps.collectDispatchDiagnostics (cyclomatic 16) pkg/behaviourtest/steps/debuglogs.go:707 — steps.collectDispatchDiagnostics has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · steps.thenHarnessWorkflowLogsContain (cyclomatic 16) · ×1
  • steps.thenHarnessWorkflowLogsContain (cyclomatic 16) pkg/behaviourtest/steps/dispatch.go:436 — steps.thenHarnessWorkflowLogsContain has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · steps.classifyMintProbeResult (cyclomatic 16) · ×1
  • steps.classifyMintProbeResult (cyclomatic 16) pkg/behaviourtest/steps/mint_probe.go:706 — steps.classifyMintProbeResult has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · steps.thenPublishedRepoMatchesFixture (cyclomatic 16) · ×1
  • steps.thenPublishedRepoMatchesFixture (cyclomatic 16) pkg/behaviourtest/steps/playback.go:788 — steps.thenPublishedRepoMatchesFixture has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mintcore.mintHTTP (cyclomatic 16) · ×1
  • mintcore.mintHTTP (cyclomatic 16) internal/mintcore/http_client.go:25 — mintcore.mintHTTP has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fullsend-codex-hook.run_post_tool_use (cyclomatic 16) · ×1
  • fullsend-codex-hook.run_post_tool_use (cyclomatic 16) internal/runtime/codex_hook/fullsend-codex-hook.py:830 — fullsend-codex-hook.run_post_tool_use has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ssrf_pretool._split_command_stages (cyclomatic 16) · ×1
  • ssrf_pretool._split_command_stages (cyclomatic 16) internal/security/hooks/ssrf_pretool.py:868 — ssrf_pretool._split_command_stages has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nextwork.take_over (cyclomatic 16) · ×1
  • nextwork.take_over (cyclomatic 16) skills/nextwork/scripts/nextwork.py:2103 — nextwork.take_over has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.runAgent (cognitive 830) · ×1
  • cli.runAgent (cognitive 830) internal/cli/run.go:493 — cli.runAgent has cognitive complexity 830 (threshold 15). Drivers by points: if/else 391 (705 pts), loops 46 (78 pts), boolean chains 42, match/switch 3 (5 pts) (nesting depth added 348). Of this number, 745 points are the body's own statements and 85 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runReposInstall (cognitive 278) · ×1
  • cli.runReposInstall (cognitive 278) internal/cli/repos.go:604 — cli.runReposInstall has cognitive complexity 278 (threshold 15). Drivers by points: if/else 110 (230 pts), loops 20 (26 pts), boolean chains 20, match/switch 2 (nesting depth added 126). Of this number, 254 points are the body's own statements and 24 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.resolveFromLock (cognitive 228) · ×1
  • cli.resolveFromLock (cognitive 228) internal/cli/lock.go:944 — cli.resolveFromLock has cognitive complexity 228 (threshold 15). Drivers by points: if/else 67 (177 pts), boolean chains 31, loops 15 (18 pts), match/switch 1 (2 pts) (nesting depth added 114). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.Run (cognitive 221) · ×1
  • Poller.Run (cognitive 221) internal/poll/poll.go:74 — Poller.Run has cognitive complexity 221 (threshold 15). Drivers by points: if/else 79 (158 pts), loops 20 (31 pts), boolean chains 24, match/switch 3 (8 pts) (nesting depth added 95). Of this number, 208 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ensureGitLabWebhookFastPath (cognitive 212) · ×1
  • repos.ensureGitLabWebhookFastPath (cognitive 212) internal/repos/gitlab_webhook.go:1956 — repos.ensureGitLabWebhookFastPath has cognitive complexity 212 (threshold 15). Drivers by points: if/else 70 (171 pts), boolean chains 27, loops 5 (11 pts), match/switch 2 (3 pts) (nesting depth added 108). Of this number, 206 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.runPerRepoInstall (cognitive 198) · ×1
  • cli.runPerRepoInstall (cognitive 198) internal/cli/admin.go:339 — cli.runPerRepoInstall has cognitive complexity 198 (threshold 15). Drivers by points: if/else 99 (173 pts), boolean chains 13, loops 5 (11 pts), match/switch 1 (nesting depth added 80). Of this number, 182 points are the body's own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.Converge (cognitive 197) · ×1
  • repos.Converge (cognitive 197) internal/repos/converge.go:770 — repos.Converge has cognitive complexity 197 (threshold 15). Drivers by points: if/else 75 (151 pts), boolean chains 21, match/switch 6 (13 pts), loops 8 (12 pts) (nesting depth added 87). Of this number, 138 points are the body's own statements and 59 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.rotateOneRole (cognitive 189) · ×1
  • repos.rotateOneRole (cognitive 189) internal/repos/gitlab_roles_rotate.go:354 — repos.rotateOneRole has cognitive complexity 189 (threshold 15). Drivers by points: if/else 80 (135 pts), boolean chains 38, loops 6 (14 pts), match/switch 1 (2 pts) (nesting depth added 64). Of this number, 186 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeRepo (cognitive 152) · ×1
  • repos.convergeRepo (cognitive 152) internal/repos/converge.go:1496 — repos.convergeRepo has cognitive complexity 152 (threshold 15). Drivers by points: if/else 65 (131 pts), boolean chains 11, loops 5 (10 pts) (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · runtime.parseClaudeStream (cognitive 152) · ×1
  • runtime.parseClaudeStream (cognitive 152) internal/runtime/claude_progress.go:244 — runtime.parseClaudeStream has cognitive complexity 152 (threshold 15). Drivers by points: if/else 35 (115 pts), loops 6 (18 pts), match/switch 5 (16 pts), boolean chains 3 (nesting depth added 103). Of this number, 150 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.discoverAllEvents (cognitive 137) · ×1
  • Poller.discoverAllEvents (cognitive 137) internal/poll/events.go:73 — Poller.discoverAllEvents has cognitive complexity 137 (threshold 15). Drivers by points: if/else 38 (105 pts), loops 7 (17 pts), boolean chains 15 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.parsePiStream (cognitive 135) · ×1
  • runtime.parsePiStream (cognitive 135) internal/runtime/pi_progress.go:356 — runtime.parsePiStream has cognitive complexity 135 (threshold 15). Drivers by points: if/else 48 (111 pts), boolean chains 12, loops 4 (6 pts), match/switch 3 (6 pts) (nesting depth added 68). Of this number, 101 points are the body's own statements and 34 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slotAllocator.Claim (cognitive 131) · ×1
  • slotAllocator.Claim (cognitive 131) REDACTED:408 — slotAllocator.Claim has cognitive complexity 131 (threshold 15). Drivers by points: if/else 33 (107 pts), match/switch 6 (18 pts), boolean chains 4, loops 2 (nesting depth added 86). Of this number, 130 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · resolve.ResolveHarness (cognitive 123) · ×1
  • resolve.ResolveHarness (cognitive 123) internal/resolve/resolve.go:285 — resolve.ResolveHarness has cognitive complexity 123 (threshold 15). Drivers by points: if/else 44 (110 pts), loops 7 (8 pts), boolean chains 5 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.lockOneAgent (cognitive 122) · ×1
  • cli.lockOneAgent (cognitive 122) internal/cli/lock.go:208 — cli.lockOneAgent has cognitive complexity 122 (threshold 15). Drivers by points: if/else 48 (103 pts), loops 7 (12 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeRefFiles (cognitive 122) · ×1
  • repos.convergeRefFiles (cognitive 122) internal/repos/converge.go:2979 — repos.convergeRefFiles has cognitive complexity 122 (threshold 15). Drivers by points: if/else 45 (95 pts), boolean chains 19, loops 3 (8 pts) (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Provisioner.provisionSelfManaged (cognitive 120) · ×1
  • Provisioner.provisionSelfManaged (cognitive 120) internal/dispatch/gcf/provisioner.go:824 — Provisioner.provisionSelfManaged has cognitive complexity 120 (threshold 15). Drivers by points: if/else 57 (98 pts), boolean chains 12, loops 5 (7 pts), match/switch 1 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.CleanupScenario (cognitive 114) · ×1
  • steps.CleanupScenario (cognitive 114) pkg/behaviourtest/steps/cleanup.go:116 — steps.CleanupScenario has cognitive complexity 114 (threshold 15). Drivers by points: if/else 56 (95 pts), loops 7 (10 pts), boolean chains 9 (nesting depth added 42). Of this number, 105 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMintDeployCloudflare (cognitive 108) · ×1
  • cli.runMintDeployCloudflare (cognitive 108) internal/cli/mint.go:910 — cli.runMintDeployCloudflare has cognitive complexity 108 (threshold 15). Drivers by points: if/else 59 (84 pts), boolean chains 15, loops 5 (9 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseScripts (cognitive 102) · ×1
  • harness.resolveBaseScripts (cognitive 102) internal/harness/compose.go:1098 — harness.resolveBaseScripts has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (85 pts), boolean chains 11, loops 4 (6 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ProbeComponentsForAuth (cognitive 102) · ×1
  • repos.ProbeComponentsForAuth (cognitive 102) internal/repos/probe.go:87 — repos.ProbeComponentsForAuth has cognitive complexity 102 (threshold 15). Drivers by points: if/else 35 (75 pts), loops 9 (14 pts), boolean chains 11, match/switch 1 (2 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.provisionOwnRoles (cognitive 100) · ×1
  • repos.provisionOwnRoles (cognitive 100) internal/repos/gitlab_roles.go:449 — repos.provisionOwnRoles has cognitive complexity 100 (threshold 15). Drivers by points: if/else 36 (95 pts), boolean chains 4, loops 1 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.runGitHubSetupPerRepo (cognitive 97) · ×1
  • cli.runGitHubSetupPerRepo (cognitive 97) internal/cli/github.go:186 — cli.runGitHubSetupPerRepo has cognitive complexity 97 (threshold 15). Drivers by points: if/else 60 (83 pts), loops 4 (7 pts), boolean chains 6, match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseResources (cognitive 93) · ×1
  • harness.resolveBaseResources (cognitive 93) internal/harness/compose.go:1305 — harness.resolveBaseResources has cognitive complexity 93 (threshold 15). Drivers by points: if/else 23 (71 pts), loops 8 (15 pts), boolean chains 7 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMintStatus (cognitive 91) · ×1
  • cli.runMintStatus (cognitive 91) internal/cli/mint.go:1753 — cli.runMintStatus has cognitive complexity 91 (threshold 15). Drivers by points: if/else 48 (72 pts), loops 6 (12 pts), boolean chains 7 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.doRequest (cognitive 89) · ×1
  • LiveClient.doRequest (cognitive 89) REDACTED:569 — LiveClient.doRequest has cognitive complexity 89 (threshold 15). Drivers by points: if/else 28 (73 pts), boolean chains 7, match/switch 2 (6 pts), loops 2 (3 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.ValidateResourceTypes (cognitive 89) · ×1
  • Harness.ValidateResourceTypes (cognitive 89) REDACTED:1169 — Harness.ValidateResourceTypes has cognitive complexity 89 (threshold 15). Drivers by points: if/else 29 (72 pts), loops 10 (11 pts), boolean chains 6 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.validateAgentEntries (cognitive 87) · ×1
  • config.validateAgentEntries (cognitive 87) internal/config/config.go:789 — config.validateAgentEntries has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (76 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest.validate (cognitive 83) · ×1
  • Manifest.validate (cognitive 83) REDACTED:762 — Manifest.validate has cognitive complexity 83 (threshold 15). Drivers by points: if/else 36 (70 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · e2etest.acquireOrg (cognitive 82) · ×1
  • e2etest.acquireOrg (cognitive 82) internal/e2etest/testutil.go:128 — e2etest.acquireOrg has cognitive complexity 82 (threshold 15). Drivers by points: if/else 25 (74 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeInstalledServiceAccount (cognitive 82) · ×1
  • repos.convergeInstalledServiceAccount (cognitive 82) internal/repos/gitlab_service_account_converge.go:251 — repos.convergeInstalledServiceAccount has cognitive complexity 82 (threshold 15). Drivers by points: if/else 30 (71 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · posttool_chain.main (cognitive 82) · ×1
  • posttool_chain.main (cognitive 82) internal/security/hooks/posttool_chain.py:299 — posttool_chain.main has cognitive complexity 82 (threshold 15). Drivers by points: if/else 27 (46 pts), error handling 10 (17 pts), loops 2 (8 pts), boolean chains 6, ternaries 1 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPullRequestReviewThreads (cognitive 80) · ×1
  • LiveClient.ListPullRequestReviewThreads (cognitive 80) internal/forge/gitlab/mr.go:878 — LiveClient.ListPullRequestReviewThreads has cognitive complexity 80 (threshold 15). Drivers by points: if/else 22 (60 pts), boolean chains 11, loops 4 (9 pts) (nesting depth added 43). Of this number, 70 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.parseCodexStream (cognitive 80) · ×1
  • runtime.parseCodexStream (cognitive 80) internal/runtime/codex_progress.go:373 — runtime.parseCodexStream has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (64 pts), boolean chains 6, loops 3 (6 pts), match/switch 3 (4 pts) (nesting depth added 39). Of this number, 41 points are the body's own statements and 39 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.triggerExtraWorkProblemForSource (cognitive 78) · ×1
  • repos.triggerExtraWorkProblemForSource (cognitive 78) internal/repos/gitlab_trigger_jobs.go:162 — repos.triggerExtraWorkProblemForSource has cognitive complexity 78 (threshold 15). Drivers by points: if/else 22 (55 pts), boolean chains 9, match/switch 4 (8 pts), loops 4 (6 pts) (nesting depth added 39). Of this number, 75 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.uninstallRepoResources (cognitive 78) · ×1
  • repos.uninstallRepoResources (cognitive 78) internal/repos/uninstall.go:318 — repos.uninstallRepoResources has cognitive complexity 78 (threshold 15). Drivers by points: if/else 35 (62 pts), loops 6 (9 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 33). Of this number, 65 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.revalidateAdditions (cognitive 77) · ×1
  • Poller.revalidateAdditions (cognitive 77) internal/poll/state.go:1189 — Poller.revalidateAdditions has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (62 pts), loops 5 (11 pts), boolean chains 4 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.serveHTTP (cognitive 77) · ×1
  • Handler.serveHTTP (cognitive 77) internal/mintcore/handler.go:236 — Handler.serveHTTP has cognitive complexity 77 (threshold 15). Drivers by points: if/else 46 (63 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest.validatePlatformRepos (cognitive 76) · ×1
  • Manifest.validatePlatformRepos (cognitive 76) REDACTED:927 — Manifest.validatePlatformRepos has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (65 pts), boolean chains 10, loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.DiagnoseGitLabWebhook (cognitive 75) · ×1
  • repos.DiagnoseGitLabWebhook (cognitive 75) internal/repos/gitlab_webhook_status.go:66 — repos.DiagnoseGitLabWebhook has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 13, match/switch 3 (5 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.listServiceAccountTokens (cognitive 72) · ×1
  • ServiceAccountTokenClient.listServiceAccountTokens (cognitive 72) internal/repos/gitlab_service_accounts.go:923 — ServiceAccountTokenClient.listServiceAccountTokens has cognitive complexity 72 (threshold 15). Drivers by points: if/else 18 (60 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LiveClient.commitFilesTo (cognitive 71) · ×1
  • LiveClient.commitFilesTo (cognitive 71) REDACTED:1762 — LiveClient.commitFilesTo has cognitive complexity 71 (threshold 15). Drivers by points: if/else 32 (59 pts), boolean chains 6, loops 5 (6 pts) (nesting depth added 28). Of this number, 69 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.LoadWithBase (cognitive 69) · ×1
  • harness.LoadWithBase (cognitive 69) internal/harness/compose.go:228 — harness.LoadWithBase has cognitive complexity 69 (threshold 15). Drivers by points: if/else 39 (66 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · e2etest.acquireOrgFromClient (cognitive 68) · ×1
  • e2etest.acquireOrgFromClient (cognitive 68) internal/e2etest/testutil.go:294 — e2etest.acquireOrgFromClient has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (60 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · harness.loadBaseChain (cognitive 68) · ×1
  • harness.loadBaseChain (cognitive 68) internal/harness/compose.go:454 — harness.loadBaseChain has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (63 pts), boolean chains 5 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.validateForge (cognitive 68) · ×1
  • Harness.validateForge (cognitive 68) internal/harness/forge.go:69 — Harness.validateForge has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 5 (10 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.executeBehaviourOp (cognitive 68) · ×1
  • runtime.executeBehaviourOp (cognitive 68) internal/runtime/dummy.go:358 — runtime.executeBehaviourOp has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (64 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 33). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · runtime.decodeClaudeStatusProgress (cognitive 67) · ×1
  • runtime.decodeClaudeStatusProgress (cognitive 67) internal/runtime/claude_status_progress.go:13 — runtime.decodeClaudeStatusProgress has cognitive complexity 67 (threshold 15). Drivers by points: if/else 26 (52 pts), match/switch 5 (11 pts), boolean chains 2, loops 1 (2 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.
D2 · Cognitive Complexity · cli.runReposUninstall (cognitive 66) · ×1
  • cli.runReposUninstall (cognitive 66) internal/cli/repos.go:1534 — cli.runReposUninstall has cognitive complexity 66 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (nesting depth added 22). Of this number, 60 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveGCFClient.GetServiceRevisionInfo (cognitive 66) · ×1
  • LiveGCFClient.GetServiceRevisionInfo (cognitive 66) internal/dispatch/gcf/gcp.go:1862 — LiveGCFClient.GetServiceRevisionInfo has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (46 pts), loops 5 (16 pts), boolean chains 4 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.commitFilesImpl (cognitive 66) · ×1
  • LiveClient.commitFilesImpl (cognitive 66) REDACTED:1186 — LiveClient.commitFilesImpl has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (55 pts), boolean chains 8, loops 2 (3 pts) (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.
D2 · Cognitive Complexity · CodexRuntime.Bootstrap (cognitive 66) · ×1
  • CodexRuntime.Bootstrap (cognitive 66) internal/runtime/codex_bootstrap.go:131 — CodexRuntime.Bootstrap has cognitive complexity 66 (threshold 15). Drivers by points: if/else 37 (56 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runLint (cognitive 65) · ×1
  • cli.runLint (cognitive 65) internal/cli/lint.go:197 — cli.runLint has cognitive complexity 65 (threshold 15). Drivers by points: if/else 33 (57 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.planAccountSchedules (cognitive 65) · ×1
  • gitLabTriggerAccountOp.planAccountSchedules (cognitive 65) internal/repos/gitlab_trigger_schedules.go:422 — gitLabTriggerAccountOp.planAccountSchedules has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (54 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 37). Of this number, 60 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabExtraWorkProblem (cognitive 64) · ×1
  • repos.gitlabExtraWorkProblem (cognitive 64) internal/repos/gitlab_trigger_jobs.go:571 — repos.gitlabExtraWorkProblem has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (57 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.releaseSchedules (cognitive 64) · ×1
  • gitLabTriggerAccountOp.releaseSchedules (cognitive 64) internal/repos/gitlab_trigger_schedules.go:729 — gitLabTriggerAccountOp.releaseSchedules has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (44 pts), loops 7 (11 pts), boolean chains 5, match/switch 1 (4 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.
D2 · Cognitive Complexity · runtime.decodeClaudeTaskProgress (cognitive 64) · ×1
  • runtime.decodeClaudeTaskProgress (cognitive 64) internal/runtime/claude_task_progress.go:46 — runtime.decodeClaudeTaskProgress has cognitive complexity 64 (threshold 15). Drivers by points: if/else 24 (48 pts), boolean chains 11, match/switch 2 (4 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.Install (cognitive 63) · ×1
  • repos.Install (cognitive 63) internal/repos/install.go:260 — repos.Install has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.bootstrapEnv (cognitive 62) · ×1
  • cli.bootstrapEnv (cognitive 62) internal/cli/run.go:4271 — cli.bootstrapEnv has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (55 pts), boolean chains 5, loops 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.resolvePersonaModels (cognitive 62) · ×1
  • runtime.resolvePersonaModels (cognitive 62) internal/runtime/pi_personas.go:208 — runtime.resolvePersonaModels has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (50 pts), boolean chains 6, loops 6 (nesting depth added 29). Of this number, 56 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.normalize_item (cognitive 61) · ×1
  • nextwork.normalize_item (cognitive 61) skills/nextwork/scripts/nextwork.py:1524 — nextwork.normalize_item has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 17, ternaries 4 (9 pts), loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.fetchBaseScriptOrDir (cognitive 60) · ×1
  • harness.fetchBaseScriptOrDir (cognitive 60) internal/harness/compose.go:1981 — harness.fetchBaseScriptOrDir has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · repos.migrateLegacyManifestTracking (cognitive 60) · ×1
  • repos.migrateLegacyManifestTracking (cognitive 60) internal/repos/manifest_legacy_tracking.go:47 — repos.migrateLegacyManifestTracking has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (49 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.planStaleVendoredCleanup (cognitive 60) · ×1
  • repos.planStaleVendoredCleanup (cognitive 60) internal/repos/stale_vendored.go:75 — repos.planStaleVendoredCleanup has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 7 (10 pts), boolean chains 7 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.resolveAgentNewOptions (cognitive 59) · ×1
  • cli.resolveAgentNewOptions (cognitive 59) internal/cli/agent_new.go:101 — cli.resolveAgentNewOptions has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (49 pts), boolean chains 9, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnicodeNormalizer.Scan (cognitive 59) · ×1
  • UnicodeNormalizer.Scan (cognitive 59) internal/security/unicode.go:64 — UnicodeNormalizer.Scan has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (42 pts), loops 8 (13 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.toNormalizedEvent (cognitive 58) · ×1
  • Poller.toNormalizedEvent (cognitive 58) internal/poll/convert.go:23 — Poller.toNormalizedEvent has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 20, match/switch 3 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeGitLabWebhookHook (cognitive 58) · ×1
  • repos.convergeGitLabWebhookHook (cognitive 58) internal/repos/gitlab_webhook.go:2690 — repos.convergeGitLabWebhookHook has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (53 pts), boolean chains 3, loops 1 (2 pts) (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.
D2 · Cognitive Complexity · pollerGenerationRun.attemptTrigger (cognitive 58) · ×1
  • pollerGenerationRun.attemptTrigger (cognitive 58) internal/repos/gitlab_poller_generation.go:794 — pollerGenerationRun.attemptTrigger has cognitive complexity 58 (threshold 15). Drivers by points: if/else 36 (51 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · e2etest.acquireLock (cognitive 57) · ×1
  • e2etest.acquireLock (cognitive 57) internal/e2etest/lock.go:27 — e2etest.acquireLock has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (54 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · repos.UnmergeGitLabCI (cognitive 57) · ×1
  • repos.UnmergeGitLabCI (cognitive 57) internal/repos/gitlabci.go:1232 — repos.UnmergeGitLabCI has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (45 pts), boolean chains 8, loops 1 (4 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · analyze-transcript.cmd_network (cognitive 57) · ×1
  • analyze-transcript.cmd_network (cognitive 57) skills/analyze-transcript/analyze-transcript.py:737 — analyze-transcript.cmd_network has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 7 (12 pts), boolean chains 4, ternaries 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · config.applyManagedLayer (cognitive 56) · ×1
  • config.applyManagedLayer (cognitive 56) internal/config/managed.go:447 — config.applyManagedLayer has cognitive complexity 56 (threshold 15). Drivers by points: if/else 33 (53 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.checkRepoStatus (cognitive 56) · ×1
  • repos.checkRepoStatus (cognitive 56) internal/repos/status.go:298 — repos.checkRepoStatus has cognitive complexity 56 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 6, loops 2, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexRuntime.Run (cognitive 55) · ×1
  • CodexRuntime.Run (cognitive 55) internal/runtime/codex_run.go:519 — CodexRuntime.Run has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (45 pts), boolean chains 10 (nesting depth added 10). Of this number, 51 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServiceAccountTokenClient.withoutSuppliedLegacy (cognitive 54) · ×1
  • ServiceAccountTokenClient.withoutSuppliedLegacy (cognitive 54) internal/repos/gitlab_service_accounts.go:726 — ServiceAccountTokenClient.withoutSuppliedLegacy has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 10, loops 2 (nesting depth added 23). Of this number, 49 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runLockAll (cognitive 52) · ×1
  • cli.runLockAll (cognitive 52) internal/cli/lock.go:519 — cli.runLockAll has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (41 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetch.FetchURL (cognitive 52) · ×1
  • fetch.FetchURL (cognitive 52) internal/fetch/fetch.go:136 — fetch.FetchURL has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (43 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 20). Of this number, 49 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseProfiles (cognitive 52) · ×1
  • harness.resolveBaseProfiles (cognitive 52) internal/harness/compose.go:1533 — harness.resolveBaseProfiles has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 8, loops 5 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest.ExpandGlobsFor (cognitive 52) · ×1
  • Manifest.ExpandGlobsFor (cognitive 52) REDACTED:1099 — Manifest.ExpandGlobsFor has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (41 pts), loops 6 (11 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.
D2 · Cognitive Complexity · runtime.validatePiGatewayModelValue (cognitive 52) · ×1
  • runtime.validatePiGatewayModelValue (cognitive 52) internal/runtime/pi_gateway.go:189 — runtime.validatePiGatewayModelValue has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · resolve-precommit-tools.resolve (cognitive 52) · ×1
  • resolve-precommit-tools.resolve (cognitive 52) internal/scaffold/fullsend-repo/scripts/resolve-precommit-tools.py:108 — resolve-precommit-tools.resolve has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 8, loops 4 (8 pts), ternaries 2 (8 pts), error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · blobJSONReadCloser.Read (cognitive 51) · ×1
  • blobJSONReadCloser.Read (cognitive 51) internal/forge/github/blobstream.go:52 — blobJSONReadCloser.Read has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (43 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · jira.resolveTextEscapes (cognitive 51) · ×1
  • jira.resolveTextEscapes (cognitive 51) internal/forge/jira/adf.go:703 — jira.resolveTextEscapes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (44 pts), boolean chains 6, loops 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.
D2 · Cognitive Complexity · Harness.Validate (cognitive 51) · ×1
  • Harness.Validate (cognitive 51) REDACTED:533 — Harness.Validate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 9, loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.mintPollerOwnedTrigger (cognitive 51) · ×1
  • repos.mintPollerOwnedTrigger (cognitive 51) internal/repos/gitlab_webhook_poller.go:441 — repos.mintPollerOwnedTrigger has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 9, match/switch 1 (nesting depth added 11). Of this number, 48 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manifestEditor.plan (cognitive 51) · ×1
  • manifestEditor.plan (cognitive 51) internal/repos/manifest_set.go:1063 — manifestEditor.plan has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 9, match/switch 2 (6 pts), loops 2 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · progressReconciler.task (cognitive 51) · ×1
  • progressReconciler.task (cognitive 51) internal/runtime/task_progress_reconciler.go:42 — progressReconciler.task has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 18 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tirith_check.check_command (cognitive 51) · ×1
  • tirith_check.check_command (cognitive 51) internal/security/hooks/tirith_check.py:252 — tirith_check.check_command has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (37 pts), error handling 7 (8 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · binary.extractSourceTree (cognitive 50) · ×1
  • binary.extractSourceTree (cognitive 50) internal/binary/download.go:234 — binary.extractSourceTree has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runGatewayRefresh (cognitive 50) · ×1
  • cli.runGatewayRefresh (cognitive 50) internal/cli/run_gateway_route.go:611 — cli.runGatewayRefresh has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (43 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runJiraRefresh (cognitive 50) · ×1
  • cli.runJiraRefresh (cognitive 50) internal/cli/run_jira.go:678 — cli.runJiraRefresh has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 3 (6 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.CheckManagedSafetyGate (cognitive 50) · ×1
  • config.CheckManagedSafetyGate (cognitive 50) internal/config/managed_safety.go:90 — config.CheckManagedSafetyGate has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 12, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseProviders (cognitive 50) · ×1
  • harness.resolveBaseProviders (cognitive 50) internal/harness/compose.go:1626 — harness.resolveBaseProviders has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.BuildConfigMap (cognitive 50) · ×1
  • harness.BuildConfigMap (cognitive 50) internal/harness/forge.go:460 — harness.BuildConfigMap has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (39 pts), loops 4 (8 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). Of this number, 46 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.Run (cognitive 50) · ×1
  • Poller.Run (cognitive 50) internal/jirapoll/poller.go:110 — Poller.Run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (40 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Event.Validate (cognitive 50) · ×1
  • Event.Validate (cognitive 50) internal/normevent/event.go:220 — Event.Validate has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28 (41 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.AppendGitLabServiceAccountStatus (cognitive 50) · ×1
  • ServiceAccountTokenClient.AppendGitLabServiceAccountStatus (cognitive 50) internal/repos/gitlab_service_account_converge.go:34 — ServiceAccountTokenClient.AppendGitLabServiceAccountStatus has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 9 (12 pts), boolean chains 6 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runOpenAIRefresh (cognitive 49) · ×1
  • cli.runOpenAIRefresh (cognitive 49) internal/cli/run_openai.go:1151 — cli.runOpenAIRefresh has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 3 (6 pts), match/switch 1 (5 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.ResolveRelativeTo (cognitive 49) · ×1
  • Harness.ResolveRelativeTo (cognitive 49) REDACTED:782 — Harness.ResolveRelativeTo has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 7 (9 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiRuntime.Bootstrap (cognitive 49) · ×1
  • PiRuntime.Bootstrap (cognitive 49) internal/runtime/pi_bootstrap.go:204 — PiRuntime.Bootstrap has cognitive complexity 49 (threshold 15). Drivers by points: if/else 33 (44 pts), loops 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.detectChanges (cognitive 48) · ×1
  • Poller.detectChanges (cognitive 48) internal/jirapoll/discover.go:46 — Poller.detectChanges has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · perRepoConfig.AgentEntries (cognitive 47) · ×1
  • perRepoConfig.AgentEntries (cognitive 47) internal/config/interfaces.go:177 — perRepoConfig.AgentEntries has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 6 (13 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.DeleteManagedServiceAccounts (cognitive 47) · ×1
  • ServiceAccountTokenClient.DeleteManagedServiceAccounts (cognitive 47) internal/repos/gitlab_service_account_converge.go:571 — ServiceAccountTokenClient.DeleteManagedServiceAccounts has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 8 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.converge (cognitive 47) · ×1
  • gitLabTriggerAccountOp.converge (cognitive 47) internal/repos/gitlab_trigger_account.go:727 — gitLabTriggerAccountOp.converge has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 5, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.resolveCodexChildModels (cognitive 47) · ×1
  • runtime.resolveCodexChildModels (cognitive 47) internal/runtime/codex_personas.go:108 — runtime.resolveCodexChildModels has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.mergeBaseIntoChild (cognitive 46) · ×1
  • harness.mergeBaseIntoChild (cognitive 46) internal/harness/compose.go:863 — harness.mergeBaseIntoChild has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31 (34 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · harness.fetchBaseDir (cognitive 46) · ×1
  • harness.fetchBaseDir (cognitive 46) internal/harness/compose.go:2387 — harness.fetchBaseDir has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 3 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sharedOrgLock.join (cognitive 46) · ×1
  • sharedOrgLock.join (cognitive 46) pkg/behaviourtest/drivers/install/orglock.go:172 — sharedOrgLock.join has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (40 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · posttool_chain._handle_failure (cognitive 46) · ×1
  • posttool_chain._handle_failure (cognitive 46) internal/security/hooks/posttool_chain.py:183 — posttool_chain._handle_failure has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 5 (10 pts), loops 2 (8 pts), boolean chains 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · repos.ContainGitLabPoller (cognitive 45) · ×1
  • repos.ContainGitLabPoller (cognitive 45) internal/repos/gitlab_poller_credential_policy.go:111 — repos.ContainGitLabPoller has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.validateManifestManaged (cognitive 45) · ×1
  • repos.validateManifestManaged (cognitive 45) internal/repos/managed_config.go:306 — repos.validateManifestManaged has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 2 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.CreateProjectAccessToken (cognitive 45) · ×1
  • ServiceAccountTokenClient.CreateProjectAccessToken (cognitive 45) internal/repos/gitlab_service_accounts.go:347 — ServiceAccountTokenClient.CreateProjectAccessToken has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (42 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.ValidatePiGatewayModelsFile (cognitive 45) · ×1
  • runtime.ValidatePiGatewayModelsFile (cognitive 45) internal/runtime/pi_gateway.go:87 — runtime.ValidatePiGatewayModelsFile has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.CreatePullRequestReview (cognitive 44) · ×1
  • LiveClient.CreatePullRequestReview (cognitive 44) internal/forge/gitlab/mr.go:476 — LiveClient.CreatePullRequestReview has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (40 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.
D2 · Cognitive Complexity · repos.ensureGitLabWebhookAccountRoute (cognitive 44) · ×1
  • repos.ensureGitLabWebhookAccountRoute (cognitive 44) internal/repos/gitlab_webhook_trigger_account.go:283 — repos.ensureGitLabWebhookAccountRoute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 7, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.build_queue (cognitive 44) · ×1
  • nextwork.build_queue (cognitive 44) skills/nextwork/scripts/nextwork.py:1881 — nextwork.build_queue has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (7 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gather.classify (cognitive 44) · ×1
  • gather.classify (cognitive 44) skills/user-forum-whats-new/scripts/gather.py:168 — gather.classify has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 7, loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runAgentRemove (cognitive 43) · ×1
  • cli.runAgentRemove (cognitive 43) internal/cli/agent.go:721 — cli.runAgentRemove has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (9 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.stageOverriddenSkill (cognitive 43) · ×1
  • cli.stageOverriddenSkill (cognitive 43) internal/cli/skill_staging.go:107 — cli.stageOverriddenSkill has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 4, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.do (cognitive 43) · ×1
  • LiveClient.do (cognitive 43) internal/forge/jira/client.go:350 — LiveClient.do has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 2 (7 pts), boolean chains 4, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.fetchBaseFile (cognitive 43) · ×1
  • harness.fetchBaseFile (cognitive 43) internal/harness/compose.go:1790 — harness.fetchBaseFile has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeScaffoldFiles (cognitive 43) · ×1
  • repos.convergeScaffoldFiles (cognitive 43) internal/repos/converge.go:3285 — repos.convergeScaffoldFiles has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.collectConvergeScaffoldFiles (cognitive 43) · ×1
  • repos.collectConvergeScaffoldFiles (cognitive 43) internal/repos/converge.go:3775 — repos.collectConvergeScaffoldFiles has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 9 (11 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · runtime.piToolsFor (cognitive 43) · ×1
  • runtime.piToolsFor (cognitive 43) internal/runtime/pi_agent.go:258 — runtime.piToolsFor has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repoEnsurer.deleteLeftoverForkOwned (cognitive 43) · ×1
  • repoEnsurer.deleteLeftoverForkOwned (cognitive 43) pkg/behaviourtest/drivers/install/ensure.go:470 — repoEnsurer.deleteLeftoverForkOwned has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 6 (nesting depth added 16). Of this number, 27 points are the body's own statements and 16 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript._accumulate_stats (cognitive 43) · ×1
  • analyze-transcript._accumulate_stats (cognitive 43) skills/analyze-transcript/analyze-transcript.py:290 — analyze-transcript._accumulate_stats has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newReconcileStatusCmd (cognitive 42) · ×1
  • cli.newReconcileStatusCmd (cognitive 42) internal/cli/reconcilestatus.go:36 — cli.newReconcileStatusCmd has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 18). None of this is in the body itself: all 42 points belong to one function literal inside it that branches (line 65). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · repos.triggerVariableOverrideProblemSeen (cognitive 42) · ×1
  • repos.triggerVariableOverrideProblemSeen (cognitive 42) internal/repos/gitlab_trigger_jobs.go:825 — repos.triggerVariableOverrideProblemSeen has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.HasFullsendEntries (cognitive 42) · ×1
  • repos.HasFullsendEntries (cognitive 42) internal/repos/gitlabci.go:445 — repos.HasFullsendEntries has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.BuildScaffoldFiles (cognitive 42) · ×1
  • repos.BuildScaffoldFiles (cognitive 42) internal/repos/install.go:581 — repos.BuildScaffoldFiles has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMintDeployGCP (cognitive 41) · ×1
  • cli.runMintDeployGCP (cognitive 41) internal/cli/mint.go:755 — cli.runMintDeployGCP has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27 (39 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.printStatusTable (cognitive 41) · ×1
  • cli.printStatusTable (cognitive 41) internal/cli/repos.go:251 — cli.printStatusTable has cognitive complexity 41 (threshold 15). Drivers by points: loops 12 (19 pts), if/else 8 (16 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · LiveClient.updateOrDeleteNote (cognitive 41) · ×1
  • LiveClient.updateOrDeleteNote (cognitive 41) internal/forge/gitlab/issue.go:419 — LiveClient.updateOrDeleteNote has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 5 (9 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.deliverBranchAndPR (cognitive 41) · ×1
  • layers.deliverBranchAndPR (cognitive 41) internal/layers/commit.go:333 — layers.deliverBranchAndPR has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (40 pts), boolean chains 1 (nesting depth added 15). Of this number, 35 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.dispatchWebhookEvents (cognitive 41) · ×1
  • Poller.dispatchWebhookEvents (cognitive 41) internal/poll/webhook_dispatch.go:170 — Poller.dispatchWebhookEvents has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeSchedules (cognitive 41) · ×1
  • repos.convergeSchedules (cognitive 41) internal/repos/converge.go:2532 — repos.convergeSchedules has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (30 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.diagnoseGitLabTriggerAccount (cognitive 41) · ×1
  • repos.diagnoseGitLabTriggerAccount (cognitive 41) internal/repos/gitlab_trigger_account_status.go:59 — repos.diagnoseGitLabTriggerAccount has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (33 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.parseDummyAgentTable (cognitive 41) · ×1
  • steps.parseDummyAgentTable (cognitive 41) pkg/behaviourtest/steps/dummy_agent.go:37 — steps.parseDummyAgentTable has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 3, match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript.cmd_conversation (cognitive 41) · ×1
  • analyze-transcript.cmd_conversation (cognitive 41) skills/analyze-transcript/analyze-transcript.py:426 — analyze-transcript.cmd_conversation has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (28 pts), ternaries 2 (10 pts), loops 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.classify_issue (cognitive 41) · ×1
  • nextwork.classify_issue (cognitive 41) skills/nextwork/scripts/nextwork.py:694 — nextwork.classify_issue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (32 pts), boolean chains 9 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · artifacts.stripRecord (cognitive 40) · ×1
  • artifacts.stripRecord (cognitive 40) internal/artifacts/telemetry.go:83 — artifacts.stripRecord has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.validateOverlayForgeConfigInherit (cognitive 40) · ×1
  • harness.validateOverlayForgeConfigInherit (cognitive 40) internal/harness/forge.go:156 — harness.validateOverlayForgeConfigInherit has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.removeObsoleteInferenceSecrets (cognitive 40) · ×1
  • repos.removeObsoleteInferenceSecrets (cognitive 40) internal/repos/converge.go:567 — repos.removeObsoleteInferenceSecrets has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.removeWorkflowRules (cognitive 40) · ×1
  • repos.removeWorkflowRules (cognitive 40) internal/repos/gitlabci.go:1907 — repos.removeWorkflowRules has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.EnsureManagedConfigDefaults (cognitive 40) · ×1
  • repos.EnsureManagedConfigDefaults (cognitive 40) internal/repos/managed_config_writeback.go:331 — repos.EnsureManagedConfigDefaults has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitlabJiraPollReconciler.Ensure (cognitive 40) · ×1
  • gitlabJiraPollReconciler.Ensure (cognitive 40) internal/repos/gitlab_jira_poll.go:79 — gitlabJiraPollReconciler.Ensure has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiRuntime.Run (cognitive 40) · ×1
  • PiRuntime.Run (cognitive 40) internal/runtime/pi_run.go:1181 — PiRuntime.Run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 8). Of this number, 36 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.runAgentSet (cognitive 39) · ×1
  • cli.runAgentSet (cognitive 39) internal/cli/agent.go:214 — cli.runAgentSet has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (34 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.routeBuiltinAgent (cognitive 39) · ×1
  • cli.routeBuiltinAgent (cognitive 39) internal/cli/dispatch_route.go:175 — cli.routeBuiltinAgent has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29 (34 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · gitfetch.FetchTree (cognitive 39) · ×1
  • gitfetch.FetchTree (cognitive 39) internal/gitfetch/gitfetch.go:48 — gitfetch.FetchTree has cognitive complexity 39 (threshold 15). Drivers by points: if/else 30 (35 pts), boolean chains 4 (nesting depth added 5). Of this number, 29 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Harness.ValidateFilesExist (cognitive 39) · ×1
  • Harness.ValidateFilesExist (cognitive 39) REDACTED:998 — Harness.ValidateFilesExist has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 14). Of this number, 36 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabWebhookReadiness (cognitive 39) · ×1
  • repos.gitlabWebhookReadiness (cognitive 39) internal/repos/gitlab_webhook.go:566 — repos.gitlabWebhookReadiness has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26 (33 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · runtime.parseOpenCodeStream (cognitive 39) · ×1
  • runtime.parseOpenCodeStream (cognitive 39) internal/runtime/opencode_progress.go:111 — runtime.parseOpenCodeStream has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.settleHarnessDispatchCount (cognitive 39) · ×1
  • Driver.settleHarnessDispatchCount (cognitive 39) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1831 — Driver.settleHarnessDispatchCount has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 10, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setup.Run (cognitive 38) · ×1
  • Setup.Run (cognitive 38) internal/appsetup/appsetup.go:230 — Setup.Run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.scanPluginTree (cognitive 38) · ×1
  • cli.scanPluginTree (cognitive 38) internal/cli/bootstrap_scan.go:106 — cli.scanPluginTree has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 6 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 110). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.sanitizeReviewResult (cognitive 38) · ×1
  • cli.sanitizeReviewResult (cognitive 38) REDACTED:949 — cli.sanitizeReviewResult has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.mintAgentTokenAtLevel (cognitive 38) · ×1
  • cli.mintAgentTokenAtLevel (cognitive 38) internal/cli/run.go:7646 — cli.mintAgentTokenAtLevel has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 5, loops 4, match/switch 1 (3 pts) (nesting depth added 10). Of this number, 31 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.HandleFetch (cognitive 38) · ×1
  • Service.HandleFetch (cognitive 38) internal/fetchsvc/service.go:147 — Service.HandleFetch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (36 pts), boolean chains 2 (nesting depth added 10). Of this number, 32 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPullRequestReviewThreads (cognitive 38) · ×1
  • LiveClient.ListPullRequestReviewThreads (cognitive 38) REDACTED:4527 — LiveClient.ListPullRequestReviewThreads has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 18). Of this number, 33 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.flattenMergeKeys (cognitive 38) · ×1
  • repos.flattenMergeKeys (cognitive 38) internal/repos/manifest_legacy_tracking.go:235 — repos.flattenMergeKeys has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 5 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.editManifestValue (cognitive 38) · ×1
  • repos.editManifestValue (cognitive 38) internal/repos/manifest_set.go:46 — repos.editManifestValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus (cognitive 38) · ×1
  • ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus (cognitive 38) internal/repos/gitlab_supplied_provenance.go:767 — ServiceAccountTokenClient.AppendGitLabSuppliedCredentialStatus has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 4, loops 2, 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.
D2 · Cognitive Complexity · progressReconciler.taskProgressIdentity (cognitive 38) · ×1
  • progressReconciler.taskProgressIdentity (cognitive 38) internal/runtime/task_progress_reconciler.go:164 — progressReconciler.taskProgressIdentity has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 12, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gcf.bundleFunctionSource (cognitive 37) · ×1
  • gcf.bundleFunctionSource (cognitive 37) internal/dispatch/gcf/provisioner.go:1910 — gcf.bundleFunctionSource has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mintclient.QueryStatus (cognitive 37) · ×1
  • mintclient.QueryStatus (cognitive 37) internal/mintclient/mintclient.go:503 — mintclient.QueryStatus has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.preflightGitLabRoleCleanup (cognitive 37) · ×1
  • repos.preflightGitLabRoleCleanup (cognitive 37) internal/repos/gitlab_roles_cleanup.go:225 — repos.preflightGitLabRoleCleanup has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 7 (14 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.decodeGitLabTriggerAccountState (cognitive 37) · ×1
  • repos.decodeGitLabTriggerAccountState (cognitive 37) internal/repos/gitlab_trigger_account.go:281 — repos.decodeGitLabTriggerAccountState has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 19, if/else 14, match/switch 2 (3 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · runtime.buildPiRunCommand (cognitive 37) · ×1
  • runtime.buildPiRunCommand (cognitive 37) internal/runtime/pi_run.go:430 — runtime.buildPiRunCommand has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (30 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CodexRuntime.ExtractTranscripts (cognitive 37) · ×1
  • CodexRuntime.ExtractTranscripts (cognitive 37) internal/runtime/codex_transcript.go:40 — CodexRuntime.ExtractTranscripts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · artifacts.prepareMetadata (cognitive 36) · ×1
  • artifacts.prepareMetadata (cognitive 36) internal/artifacts/prepare.go:206 — artifacts.prepareMetadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.validateTracking (cognitive 36) · ×1
  • config.validateTracking (cognitive 36) internal/config/issue_targets.go:481 — config.validateTracking has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.CleanupGitLabRoleIdentityLocked (cognitive 36) · ×1
  • repos.CleanupGitLabRoleIdentityLocked (cognitive 36) internal/repos/gitlab_roles_cleanup.go:99 — repos.CleanupGitLabRoleIdentityLocked has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 3, loops 1 (nesting depth added 11). Of this number, 31 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve.resolveSkillDirURL (cognitive 36) · ×1
  • resolve.resolveSkillDirURL (cognitive 36) internal/resolve/resolve.go:675 — resolve.resolveSkillDirURL has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25 (36 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.harnessPollOnce (cognitive 36) · ×1
  • Driver.harnessPollOnce (cognitive 36) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1281 — Driver.harnessPollOnce has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · nextwork.classify_pr (cognitive 36) · ×1
  • nextwork.classify_pr (cognitive 36) skills/nextwork/scripts/nextwork.py:938 — nextwork.classify_pr has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 10 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.profileIssuesCredential (cognitive 35) · ×1
  • cli.profileIssuesCredential (cognitive 35) internal/cli/gitlab_profile.go:579 — cli.profileIssuesCredential has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.createCommitOnBranch (cognitive 35) · ×1
  • LiveClient.createCommitOnBranch (cognitive 35) internal/forge/github/commit_graphql.go:94 — LiveClient.createCommitOnBranch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseHostFiles (cognitive 35) · ×1
  • harness.resolveBaseHostFiles (cognitive 35) internal/harness/compose.go:1455 — harness.resolveBaseHostFiles has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.fetchBaseSkill (cognitive 35) · ×1
  • harness.fetchBaseSkill (cognitive 35) internal/harness/compose.go:2184 — harness.fetchBaseSkill has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · repos.RotateGitLabRoleCredentials (cognitive 35) · ×1
  • repos.RotateGitLabRoleCredentials (cognitive 35) internal/repos/gitlab_roles_rotate.go:232 — repos.RotateGitLabRoleCredentials has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 5, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.resolveExtendsAdmission (cognitive 35) · ×1
  • repos.resolveExtendsAdmission (cognitive 35) internal/repos/gitlab_trigger_job_templates.go:128 — repos.resolveExtendsAdmission has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.parseManifestPath (cognitive 35) · ×1
  • repos.parseManifestPath (cognitive 35) internal/repos/manifest_set.go:394 — repos.parseManifestPath has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.openAIWIFVariableIdentifiers (cognitive 35) · ×1
  • repos.openAIWIFVariableIdentifiers (cognitive 35) internal/repos/openai_wif.go:103 — repos.openAIWIFVariableIdentifiers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workflowExprParser.parseOperand (cognitive 35) · ×1
  • workflowExprParser.parseOperand (cognitive 35) internal/repos/gitlab_workflow_admission.go:230 — workflowExprParser.parseOperand has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 9, loops 3 (6 pts), 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.
D2 · Cognitive Complexity · resolve-precommit-tools.merge_registries (cognitive 35) · ×1
  • resolve-precommit-tools.merge_registries (cognitive 35) internal/scaffold/fullsend-repo/scripts/resolve-precommit-tools.py:42 — resolve-precommit-tools.merge_registries has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 6, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.bootstrapCommon (cognitive 34) · ×1
  • cli.bootstrapCommon (cognitive 34) internal/cli/run.go:3420 — cli.bootstrapCommon has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (34 pts) (nesting depth added 13). Of this number, 30 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.ensureOpenAIProvider (cognitive 34) · ×1
  • cli.ensureOpenAIProvider (cognitive 34) internal/cli/run_openai.go:890 — cli.ensureOpenAIProvider has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · envmanifest.shellCommands (cognitive 34) · ×1
  • envmanifest.shellCommands (cognitive 34) internal/envmanifest/shellexports.go:141 — envmanifest.shellCommands has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 9, loops 3 (7 pts), match/switch 2 (6 pts) (nesting depth added 14). Of this number, 31 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · input.mapIssueCommentEvent (cognitive 34) · ×1
  • input.mapIssueCommentEvent (cognitive 34) internal/harnessdispatch/input/ghaevent.go:269 — input.mapIssueCommentEvent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 2, match/switch 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · repos.LockGitLabProject (cognitive 34) · ×1
  • repos.LockGitLabProject (cognitive 34) internal/repos/gitlab_roles.go:67 — repos.LockGitLabProject has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 14). Of this number, 30 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.RemoveFromManifest (cognitive 34) · ×1
  • repos.RemoveFromManifest (cognitive 34) internal/repos/manifest_edit.go:95 — repos.RemoveFromManifest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 12). Of this number, 29 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manifestEditor.prepareSplice (cognitive 34) · ×1
  • manifestEditor.prepareSplice (cognitive 34) internal/repos/manifest_set.go:1352 — manifestEditor.prepareSplice has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 19). Of this number, 24 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.injectFrontmatterSkills (cognitive 34) · ×1
  • runtime.injectFrontmatterSkills (cognitive 34) internal/runtime/frontmatter_skills.go:146 — runtime.injectFrontmatterSkills has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 5, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenCodeRuntime.Run (cognitive 34) · ×1
  • OpenCodeRuntime.Run (cognitive 34) internal/runtime/opencode_run.go:426 — OpenCodeRuntime.Run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 7, match/switch 1 (nesting depth added 3). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EventRenderer.Handle (cognitive 34) · ×1
  • EventRenderer.Handle (cognitive 34) internal/runtime/renderer.go:43 — EventRenderer.Handle has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SecretRedactor.Scan (cognitive 34) · ×1
  • SecretRedactor.Scan (cognitive 34) internal/security/redactor.go:89 — SecretRedactor.Scan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 7 (13 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.describeDispatchRuns (cognitive 34) · ×1
  • steps.describeDispatchRuns (cognitive 34) pkg/behaviourtest/steps/debuglogs.go:803 — steps.describeDispatchRuns has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 8, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ssrf_pretool._has_command_substitution (cognitive 34) · ×1
  • ssrf_pretool._has_command_substitution (cognitive 34) internal/security/hooks/ssrf_pretool.py:812 — ssrf_pretool._has_command_substitution has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.pinnedSetupFlags (cognitive 33) · ×1
  • cli.pinnedSetupFlags (cognitive 33) internal/cli/github.go:682 — cli.pinnedSetupFlags has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 13 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.submitFormalReviewWithDiffs (cognitive 33) · ×1
  • cli.submitFormalReviewWithDiffs (cognitive 33) REDACTED:502 — cli.submitFormalReviewWithDiffs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · config.ReadLegacyTracking (cognitive 33) · ×1
  • config.ReadLegacyTracking (cognitive 33) internal/config/legacy_tracking.go:83 — config.ReadLegacyTracking has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 8 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthorizationProvider.UnmarshalYAML (cognitive 33) · ×1
  • AuthorizationProvider.UnmarshalYAML (cognitive 33) internal/config/config.go:365 — AuthorizationProvider.UnmarshalYAML has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · e2eauth.Check (cognitive 33) · ×1
  • e2eauth.Check (cognitive 33) internal/e2eauth/check.go:43 — e2eauth.Check has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (32 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.
D2 · Cognitive Complexity · e2etest.CleanupStaleResources (cognitive 33) · ×1
  • e2etest.CleanupStaleResources (cognitive 33) internal/e2etest/cleanup.go:21 — e2etest.CleanupStaleResources has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jira.adfMarkdownBlock (cognitive 33) · ×1
  • jira.adfMarkdownBlock (cognitive 33) internal/forge/jira/adf.go:984 — jira.adfMarkdownBlock has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · repos.gitlabDispatcherTemplateProblem (cognitive 33) · ×1
  • repos.gitlabDispatcherTemplateProblem (cognitive 33) internal/repos/gitlab_trigger_jobs.go:729 — repos.gitlabDispatcherTemplateProblem has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 9, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.diffLineMatches (cognitive 33) · ×1
  • repos.diffLineMatches (cognitive 33) internal/repos/gitlabci_format.go:174 — repos.diffLineMatches has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 6 (10 pts), boolean chains 8 (nesting depth added 11). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.openAIWIFWorkflowProblem (cognitive 33) · ×1
  • repos.openAIWIFWorkflowProblem (cognitive 33) internal/repos/openai_wif.go:573 — repos.openAIWIFWorkflowProblem has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (14 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentnew.Generate (cognitive 32) · ×1
  • agentnew.Generate (cognitive 32) internal/agentnew/generate.go:63 — agentnew.Generate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 4, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 10). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.bindGitLabCredentialToForgeHost (cognitive 32) · ×1
  • cli.bindGitLabCredentialToForgeHost (cognitive 32) internal/cli/gitlab_profile.go:179 — cli.bindGitLabCredentialToForgeHost has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 1, loops 1 (nesting depth added 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runIssuesCreate (cognitive 32) · ×1
  • cli.runIssuesCreate (cognitive 32) internal/cli/issues.go:294 — cli.runIssuesCreate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.rewriteFrontmatterSkills (cognitive 32) · ×1
  • runtime.rewriteFrontmatterSkills (cognitive 32) internal/runtime/frontmatter_skills.go:33 — runtime.rewriteFrontmatterSkills has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Notifier.PostCompletionWithDetail (cognitive 32) · ×1
  • Notifier.PostCompletionWithDetail (cognitive 32) internal/statuscomment/statuscomment.go:347 — Notifier.PostCompletionWithDetail has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mintcore.ParseCustomRolePermissions (cognitive 32) · ×1
  • mintcore.ParseCustomRolePermissions (cognitive 32) internal/mintcore/github.go:278 — mintcore.ParseCustomRolePermissions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (12 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork._format_mutation_line (cognitive 32) · ×1
  • nextwork._format_mutation_line (cognitive 32) skills/nextwork/scripts/nextwork.py:2503 — nextwork._format_mutation_line has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 7 (9 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.main (cognitive 32) · ×1
  • nextwork.main (cognitive 32) skills/nextwork/scripts/nextwork.py:2761 — nextwork.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 3 (5 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.revalidateRemovals (cognitive 31) · ×1
  • Poller.revalidateRemovals (cognitive 31) internal/poll/state.go:1099 — Poller.revalidateRemovals has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.activatePipelineSchedules (cognitive 31) · ×1
  • repos.activatePipelineSchedules (cognitive 31) internal/repos/converge.go:2754 — repos.activatePipelineSchedules has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabTriggerOwnerProblemSkipping (cognitive 31) · ×1
  • repos.gitlabTriggerOwnerProblemSkipping (cognitive 31) internal/repos/gitlab_webhook.go:997 — repos.gitlabTriggerOwnerProblemSkipping has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabRootCIDispatcherProblem (cognitive 31) · ×1
  • repos.gitlabRootCIDispatcherProblem (cognitive 31) internal/repos/gitlab_webhook.go:1535 — repos.gitlabRootCIDispatcherProblem has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (27 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.
D2 · Cognitive Complexity · repos.convergeJiraPoll (cognitive 31) · ×1
  • repos.convergeJiraPoll (cognitive 31) internal/repos/jira_poll.go:297 — repos.convergeJiraPoll has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.scheduleOwnershipDrift (cognitive 31) · ×1
  • gitLabTriggerAccountOp.scheduleOwnershipDrift (cognitive 31) internal/repos/gitlab_trigger_account_status.go:224 — gitLabTriggerAccountOp.scheduleOwnershipDrift has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.mintStatusFacts (cognitive 31) · ×1
  • steps.mintStatusFacts (cognitive 31) pkg/behaviourtest/steps/mint_status.go:504 — steps.mintStatusFacts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 6 (10 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.
D2 · Cognitive Complexity · mintcore.NewHandler (cognitive 31) · ×1
  • mintcore.NewHandler (cognitive 31) internal/mintcore/handler.go:119 — mintcore.NewHandler has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 6 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript.cmd_audit (cognitive 31) · ×1
  • analyze-transcript.cmd_audit (cognitive 31) skills/analyze-transcript/analyze-transcript.py:576 — analyze-transcript.cmd_audit has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.maskSecretLiterals (cognitive 30) · ×1
  • cli.maskSecretLiterals (cognitive 30) internal/cli/run.go:4787 — cli.maskSecretLiterals has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (13 pts), boolean chains 4 (nesting depth added 14). Of this number, 27 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.resolveOpenAICredential (cognitive 30) · ×1
  • cli.resolveOpenAICredential (cognitive 30) internal/cli/run_openai.go:516 — cli.resolveOpenAICredential has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · contentCollector.Result (cognitive 30) · ×1
  • contentCollector.Result (cognitive 30) internal/cli/content_collector.go:585 — contentCollector.Result has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 4, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · envmanifest.collectFromCommand (cognitive 30) · ×1
  • envmanifest.collectFromCommand (cognitive 30) internal/envmanifest/shellexports.go:87 — envmanifest.collectFromCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPullRequestFileDiffs (cognitive 30) · ×1
  • LiveClient.ListPullRequestFileDiffs (cognitive 30) REDACTED:4362 — LiveClient.ListPullRequestFileDiffs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.doAttempts (cognitive 30) · ×1
  • LiveClient.doAttempts (cognitive 30) internal/forge/gitlab/gitlab.go:193 — LiveClient.doAttempts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.CheckFileContentDrift (cognitive 30) · ×1
  • repos.CheckFileContentDrift (cognitive 30) internal/repos/drift.go:43 — repos.CheckFileContentDrift has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.suppliedAwareInventory (cognitive 30) · ×1
  • repos.suppliedAwareInventory (cognitive 30) internal/repos/gitlab_roles_rotate.go:1901 — repos.suppliedAwareInventory has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.GitLabWebhookNeedsProvisioning (cognitive 30) · ×1
  • repos.GitLabWebhookNeedsProvisioning (cognitive 30) internal/repos/gitlab_webhook.go:471 — repos.GitLabWebhookNeedsProvisioning has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.resolveManifestPath (cognitive 30) · ×1
  • repos.resolveManifestPath (cognitive 30) internal/repos/manifest_set.go:498 — repos.resolveManifestPath has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 7, match/switch 2 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.checkForgeFields (cognitive 30) · ×1
  • repos.checkForgeFields (cognitive 30) internal/repos/manifest_set.go:582 — repos.checkForgeFields has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workflowExprParser.parseComparison (cognitive 30) · ×1
  • workflowExprParser.parseComparison (cognitive 30) internal/repos/gitlab_workflow_admission.go:171 — workflowExprParser.parseComparison has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.buildRunCommandWithDigests (cognitive 30) · ×1
  • runtime.buildRunCommandWithDigests (cognitive 30) internal/runtime/claude.go:813 — runtime.buildRunCommandWithDigests has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (27 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.countCodexChildRollouts (cognitive 30) · ×1
  • runtime.countCodexChildRollouts (cognitive 30) internal/runtime/codex_subagents.go:580 — runtime.countCodexChildRollouts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scaffold.FindStaleVendoredAssets (cognitive 30) · ×1
  • scaffold.FindStaleVendoredAssets (cognitive 30) internal/scaffold/vendorcleanup.go:61 — scaffold.FindStaleVendoredAssets has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SSRFValidator.ValidateURL (cognitive 30) · ×1
  • SSRFValidator.ValidateURL (cognitive 30) internal/security/ssrf.go:119 — SSRFValidator.ValidateURL has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · multiPunctAnnotation.tokenAnnotation (cognitive 30) · ×1
  • multiPunctAnnotation.tokenAnnotation (cognitive 30) internal/sentencetoken/annotate.go:150 — multiPunctAnnotation.tokenAnnotation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tracecontext.NormalizeInstance (cognitive 30) · ×1
  • tracecontext.NormalizeInstance (cognitive 30) internal/telemetry/tracecontext/identity.go:145 — tracecontext.NormalizeInstance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 10, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · JiraClient.TransitionIssue (cognitive 30) · ×1
  • JiraClient.TransitionIssue (cognitive 30) internal/tracker/transition.go:100 — JiraClient.TransitionIssue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.apply_trivial_actions (cognitive 30) · ×1
  • nextwork.apply_trivial_actions (cognitive 30) skills/nextwork/scripts/nextwork.py:2003 — nextwork.apply_trivial_actions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runAgentList (cognitive 29) · ×1
  • cli.runAgentList (cognitive 29) internal/cli/agent.go:452 — cli.runAgentList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.pinAgentURL (cognitive 29) · ×1
  • cli.pinAgentURL (cognitive 29) internal/cli/agent.go:817 — cli.pinAgentURL has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runInferenceGatewayStatus (cognitive 29) · ×1
  • cli.runInferenceGatewayStatus (cognitive 29) internal/cli/inference_gateway.go:189 — cli.runInferenceGatewayStatus has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (21 pts), match/switch 4, boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.runMintDeleteCloudflare (cognitive 29) · ×1
  • cli.runMintDeleteCloudflare (cognitive 29) internal/cli/mint_delete.go:249 — cli.runMintDeleteCloudflare has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newScanInputCmd (cognitive 29) · ×1
  • cli.newScanInputCmd (cognitive 29) REDACTED:55 — cli.newScanInputCmd has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 65). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Provisioner.ensureWIFPoolAndProvider (cognitive 29) · ×1
  • Provisioner.ensureWIFPoolAndProvider (cognitive 29) internal/dispatch/gcf/provisioner.go:1282 — Provisioner.ensureWIFPoolAndProvider has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (9 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalmeasure.ParseTelemetryFile (cognitive 29) · ×1
  • evalmeasure.ParseTelemetryFile (cognitive 29) internal/evalmeasure/parse.go:64 — evalmeasure.ParseTelemetryFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (13 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.retryCommitWithoutStartSHA (cognitive 29) · ×1
  • LiveClient.retryCommitWithoutStartSHA (cognitive 29) REDACTED:1497 — LiveClient.retryCommitWithoutStartSHA has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ServiceAccountTokenClient.managedServiceAccountList (cognitive 29) · ×1
  • ServiceAccountTokenClient.managedServiceAccountList (cognitive 29) internal/repos/gitlab_service_accounts.go:241 — ServiceAccountTokenClient.managedServiceAccountList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 9, loops 1 (nesting depth added 7). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DummyPlaybackRuntime.Run (cognitive 29) · ×1
  • DummyPlaybackRuntime.Run (cognitive 29) REDACTED:108 — DummyPlaybackRuntime.Run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tracecontext.Parse (cognitive 29) · ×1
  • tracecontext.Parse (cognitive 29) internal/telemetry/tracecontext/envelope.go:267 — tracecontext.Parse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 1, match/switch 1 (nesting depth added 5). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Driver.failedHarnessPollOnce (cognitive 29) · ×1
  • Driver.failedHarnessPollOnce (cognitive 29) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:680 — Driver.failedHarnessPollOnce has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · steps.collectScenarioRunLogs (cognitive 29) · ×1
  • steps.collectScenarioRunLogs (cognitive 29) pkg/behaviourtest/steps/debuglogs.go:612 — steps.collectScenarioRunLogs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.givenURLSourcedCustomHarness (cognitive 29) · ×1
  • steps.givenURLSourcedCustomHarness (cognitive 29) pkg/behaviourtest/steps/url_dispatch.go:265 — steps.givenURLSourcedCustomHarness has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 3, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · fullsend-codex-hook.run_post_tool_use (cognitive 29) · ×1
  • fullsend-codex-hook.run_post_tool_use (cognitive 29) internal/runtime/codex_hook/fullsend-codex-hook.py:830 — fullsend-codex-hook.run_post_tool_use has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ssrf_pretool._parse_egress_allowlist (cognitive 29) · ×1
  • ssrf_pretool._parse_egress_allowlist (cognitive 29) internal/security/hooks/ssrf_pretool.py:258 — ssrf_pretool._parse_egress_allowlist has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nextwork.format_markdown_output (cognitive 29) · ×1
  • nextwork.format_markdown_output (cognitive 29) skills/nextwork/scripts/nextwork.py:2548 — nextwork.format_markdown_output has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.runAgentNew (cognitive 28) · ×1
  • cli.runAgentNew (cognitive 28) internal/cli/agent_new.go:246 — cli.runAgentNew has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 6 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runIssuesGet (cognitive 28) · ×1
  • cli.runIssuesGet (cognitive 28) internal/cli/issues.go:140 — cli.runIssuesGet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · contentCollector.toolArguments (cognitive 28) · ×1
  • contentCollector.toolArguments (cognitive 28) internal/cli/content_collector.go:968 — contentCollector.toolArguments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · perRepoConfig.validateLocalFields (cognitive 28) · ×1
  • perRepoConfig.validateLocalFields (cognitive 28) internal/config/config.go:1265 — perRepoConfig.validateLocalFields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · evalmeasure.ExportOTLPScores (cognitive 28) · ×1
  • evalmeasure.ExportOTLPScores (cognitive 28) internal/evalmeasure/export_otlp.go:96 — evalmeasure.ExportOTLPScores has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 3, loops 2 (nesting depth added 5). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TriggerOwner.noPollerMember (cognitive 28) · ×1
  • TriggerOwner.noPollerMember (cognitive 28) internal/gitlablifecycle/trigger_owner.go:513 — TriggerOwner.noPollerMember has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.restoreSharedFailureMirrors (cognitive 28) · ×1
  • poll.restoreSharedFailureMirrors (cognitive 28) internal/poll/state.go:1567 — poll.restoreSharedFailureMirrors has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeContentDriftFiles (cognitive 28) · ×1
  • repos.convergeContentDriftFiles (cognitive 28) internal/repos/converge.go:3453 — repos.convergeContentDriftFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.CheckOrphanVars (cognitive 28) · ×1
  • repos.CheckOrphanVars (cognitive 28) internal/repos/drift.go:195 — repos.CheckOrphanVars has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.retireSupersededPollerGeneration (cognitive 28) · ×1
  • repos.retireSupersededPollerGeneration (cognitive 28) internal/repos/gitlab_poller_retirement.go:90 — repos.retireSupersededPollerGeneration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.cleanupOutgoing (cognitive 28) · ×1
  • repos.cleanupOutgoing (cognitive 28) internal/repos/gitlab_roles_rotate.go:1233 — repos.cleanupOutgoing has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 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.
D2 · Cognitive Complexity · repos.PreflightProposedManagedSafety (cognitive 28) · ×1
  • repos.PreflightProposedManagedSafety (cognitive 28) internal/repos/managed_config_writeback.go:137 — repos.PreflightProposedManagedSafety has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · statuscomment.ReconcileOrphaned (cognitive 28) · ×1
  • statuscomment.ReconcileOrphaned (cognitive 28) internal/statuscomment/statuscomment.go:778 — statuscomment.ReconcileOrphaned has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · Driver.WaitForWorkflow (cognitive 28) · ×1
  • Driver.WaitForWorkflow (cognitive 28) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:147 — Driver.WaitForWorkflow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · traceCollector.stop (cognitive 28) · ×1
  • traceCollector.stop (cognitive 28) REDACTED:614 — traceCollector.stop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ssrf_pretool._split_command_stages (cognitive 28) · ×1
  • ssrf_pretool._split_command_stages (cognitive 28) internal/security/hooks/ssrf_pretool.py:868 — ssrf_pretool._split_command_stages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.extractEvents (cognitive 27) · ×1
  • main.extractEvents (cognitive 27) hack/prove-otlp-scores/main.go:180 — main.extractEvents has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 1 (6 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · cli.restrictGitLabEndpointsToForge (cognitive 27) · ×1
  • cli.restrictGitLabEndpointsToForge (cognitive 27) internal/cli/gitlab_profile.go:289 — cli.restrictGitLabEndpointsToForge has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 5, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.runMintDeleteGCP (cognitive 27) · ×1
  • cli.runMintDeleteGCP (cognitive 27) internal/cli/mint_delete.go:118 — cli.runMintDeleteGCP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.reseedCredential (cognitive 27) · ×1
  • cli.reseedCredential (cognitive 27) internal/cli/run_openai.go:363 — cli.reseedCredential has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). Of this number, 15 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalmeasure.ScoreFitnessNamed (cognitive 27) · ×1
  • evalmeasure.ScoreFitnessNamed (cognitive 27) internal/evalmeasure/fitness.go:24 — evalmeasure.ScoreFitnessNamed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.decodePollerGenerations (cognitive 27) · ×1
  • repos.decodePollerGenerations (cognitive 27) internal/repos/gitlab_poller_generation.go:230 — repos.decodePollerGenerations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.loadRotationState (cognitive 27) · ×1
  • repos.loadRotationState (cognitive 27) internal/repos/gitlab_roles_rotate.go:1445 — repos.loadRotationState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.TeardownGitLabWebhookFastPathLocked (cognitive 27) · ×1
  • repos.TeardownGitLabWebhookFastPathLocked (cognitive 27) internal/repos/gitlab_webhook.go:2584 — repos.TeardownGitLabWebhookFastPathLocked has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.resolveManifestTarget (cognitive 27) · ×1
  • repos.resolveManifestTarget (cognitive 27) internal/repos/manifest_set.go:278 — repos.resolveManifestTarget has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest.UndeclaredSelectors (cognitive 27) · ×1
  • Manifest.UndeclaredSelectors (cognitive 27) REDACTED:1625 — Manifest.UndeclaredSelectors has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · githubactions.extractArtifactZip (cognitive 27) · ×1
  • githubactions.extractArtifactZip (cognitive 27) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:586 — githubactions.extractArtifactZip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.downloadArtifactAfter (cognitive 27) · ×1
  • Driver.downloadArtifactAfter (cognitive 27) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:433 — Driver.downloadArtifactAfter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitlabci.extractArtifactZip (cognitive 27) · ×1
  • gitlabci.extractArtifactZip (cognitive 27) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:919 — gitlabci.extractArtifactZip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · artifacts.stripSpan (cognitive 26) · ×1
  • artifacts.stripSpan (cognitive 26) internal/artifacts/telemetry.go:150 — artifacts.stripSpan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runDispatch (cognitive 26) · ×1
  • cli.runDispatch (cognitive 26) internal/cli/dispatch.go:122 — cli.runDispatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newForeignRevokeCmd (cognitive 26) · ×1
  • cli.newForeignRevokeCmd (cognitive 26) internal/cli/foreign.go:266 — cli.newForeignRevokeCmd has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (26 pts) (nesting depth added 7). None of this is in the body itself: all 26 points belong to one function literal inside it that branches (line 271). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.annotateGitLabRoleLifecycle (cognitive 26) · ×1
  • cli.annotateGitLabRoleLifecycle (cognitive 26) internal/cli/repos_gitlab.go:169 — cli.annotateGitLabRoleLifecycle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.provisionWithExistingMint (cognitive 26) · ×1
  • Provisioner.provisionWithExistingMint (cognitive 26) internal/dispatch/gcf/provisioner.go:756 — Provisioner.provisionWithExistingMint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · envfile.Load (cognitive 26) · ×1
  • envfile.Load (cognitive 26) internal/envfile/envfile.go:33 — envfile.Load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 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.
D2 · Cognitive Complexity · evalmeasure.MeasureAndExport (cognitive 26) · ×1
  • evalmeasure.MeasureAndExport (cognitive 26) internal/evalmeasure/run.go:38 — evalmeasure.MeasureAndExport has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Client.DoRequest (cognitive 26) · ×1
  • Client.DoRequest (cognitive 26) internal/gcp/client.go:130 — Client.DoRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.MergeDuplicateSkillOverrides (cognitive 26) · ×1
  • harness.MergeDuplicateSkillOverrides (cognitive 26) internal/harness/skill_entry.go:232 — harness.MergeDuplicateSkillOverrides has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 7 (12 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.ValidateAllowedRemoteResources (cognitive 26) · ×1
  • Harness.ValidateAllowedRemoteResources (cognitive 26) REDACTED:1121 — Harness.ValidateAllowedRemoteResources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginformat.PiArgsProblem (cognitive 26) · ×1
  • pluginformat.PiArgsProblem (cognitive 26) internal/pluginformat/pi.go:75 — pluginformat.PiArgsProblem has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeGitLabRootCIFiles (cognitive 26) · ×1
  • repos.convergeGitLabRootCIFiles (cognitive 26) internal/repos/converge.go:2853 — repos.convergeGitLabRootCIFiles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.probeGitLabWebhookState (cognitive 26) · ×1
  • repos.probeGitLabWebhookState (cognitive 26) internal/repos/gitlab_webhook.go:255 — repos.probeGitLabWebhookState has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.rejectRemovedConfigSiblings (cognitive 26) · ×1
  • repos.rejectRemovedConfigSiblings (cognitive 26) REDACTED:427 — repos.rejectRemovedConfigSiblings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). Of this number, 21 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiRuntime.piAgentManifestFor (cognitive 26) · ×1
  • PiRuntime.piAgentManifestFor (cognitive 26) internal/runtime/pi_bootstrap.go:534 — PiRuntime.piAgentManifestFor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 2 (4 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.
D2 · Cognitive Complexity · Driver.WaitForWorkflow (cognitive 26) · ×1
  • Driver.WaitForWorkflow (cognitive 26) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:121 — Driver.WaitForWorkflow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.harnessRoundPollOnce (cognitive 26) · ×1
  • Driver.harnessRoundPollOnce (cognitive 26) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1431 — Driver.harnessRoundPollOnce has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.failedHarnessPollOnce (cognitive 26) · ×1
  • Driver.failedHarnessPollOnce (cognitive 26) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1660 — Driver.failedHarnessPollOnce has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · retryselect.scenarioLines (cognitive 26) · ×1
  • retryselect.scenarioLines (cognitive 26) pkg/behaviourtest/retryselect/retryselect.go:161 — retryselect.scenarioLines has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (6 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.
D2 · Cognitive Complexity · steps.parseMintStatusOutput (cognitive 26) · ×1
  • steps.parseMintStatusOutput (cognitive 26) pkg/behaviourtest/steps/mint_status.go:449 — steps.parseMintStatusOutput has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ssrf_pretool._find_unquoted_separators (cognitive 26) · ×1
  • ssrf_pretool._find_unquoted_separators (cognitive 26) internal/security/hooks/ssrf_pretool.py:533 — ssrf_pretool._find_unquoted_separators has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adr_corner.discussion_points (cognitive 26) · ×1
  • adr_corner.discussion_points (cognitive 26) skills/adr-corner/scripts/adr_corner.py:329 — adr_corner.discussion_points has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, loops 5 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 25) · ×1
  • main.main (cognitive 25) hack/prove-otlp-scores/main.go:27 — main.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 2, loops 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.renderJiraSiteProfileFrom (cognitive 25) · ×1
  • cli.renderJiraSiteProfileFrom (cognitive 25) internal/cli/run_jira.go:237 — cli.renderJiraSiteProfileFrom has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.refreshOpenAIProvider (cognitive 25) · ×1
  • cli.refreshOpenAIProvider (cognitive 25) internal/cli/run_openai.go:1061 — cli.refreshOpenAIProvider has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gcf.addDirToZipRooted (cognitive 25) · ×1
  • gcf.addDirToZipRooted (cognitive 25) internal/dispatch/gcf/provisioner.go:2046 — gcf.addDirToZipRooted has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.pullRequestFileModes (cognitive 25) · ×1
  • LiveClient.pullRequestFileModes (cognitive 25) REDACTED:4266 — LiveClient.pullRequestFileModes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.mergeForgeConfigInto (cognitive 25) · ×1
  • harness.mergeForgeConfigInto (cognitive 25) internal/harness/compose.go:2842 — harness.mergeForgeConfigInto has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · repos.convergeGitLabTriggerAccountLocked (cognitive 25) · ×1
  • repos.convergeGitLabTriggerAccountLocked (cognitive 25) internal/repos/gitlab_trigger_account.go:494 — repos.convergeGitLabTriggerAccountLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.expandRuleReferences (cognitive 25) · ×1
  • repos.expandRuleReferences (cognitive 25) internal/repos/gitlab_trigger_job_templates.go:202 — repos.expandRuleReferences has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabTriggerOwnerSafety (cognitive 25) · ×1
  • repos.gitlabTriggerOwnerSafety (cognitive 25) internal/repos/gitlab_webhook.go:861 — repos.gitlabTriggerOwnerSafety has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.evaluateRules (cognitive 25) · ×1
  • repos.evaluateRules (cognitive 25) internal/repos/gitlab_workflow_admission.go:326 — repos.evaluateRules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.hasNullStringElement (cognitive 25) · ×1
  • repos.hasNullStringElement (cognitive 25) internal/repos/manifest_set.go:805 — repos.hasNullStringElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · runtime.RenderPiGatewayConfig (cognitive 25) · ×1
  • runtime.RenderPiGatewayConfig (cognitive 25) internal/runtime/pi_gateway.go:395 — runtime.RenderPiGatewayConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.discoverPersonas (cognitive 25) · ×1
  • runtime.discoverPersonas (cognitive 25) internal/runtime/pi_personas.go:92 — runtime.discoverPersonas has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), match/switch 1 (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.
D2 · Cognitive Complexity · runtime.taskProgressMessage (cognitive 25) · ×1
  • runtime.taskProgressMessage (cognitive 25) internal/runtime/task_progress_message.go:6 — runtime.taskProgressMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.harnessPollOnce (cognitive 25) · ×1
  • Driver.harnessPollOnce (cognitive 25) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:468 — Driver.harnessPollOnce has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Driver.harnessRoundPollOnce (cognitive 25) · ×1
  • Driver.harnessRoundPollOnce (cognitive 25) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:570 — Driver.harnessRoundPollOnce has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behaviourtest.RunSuite (cognitive 25) · ×1
  • behaviourtest.RunSuite (cognitive 25) pkg/behaviourtest/run.go:41 — behaviourtest.RunSuite has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (25 pts) (nesting depth added 7). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.roundDisposition (cognitive 25) · ×1
  • steps.roundDisposition (cognitive 25) pkg/behaviourtest/steps/playback.go:671 — steps.roundDisposition has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mintcore.validateCustomRoleLevels (cognitive 25) · ×1
  • mintcore.validateCustomRoleLevels (cognitive 25) internal/mintcore/github.go:165 — mintcore.validateCustomRoleLevels has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · secret_redact_posttool.structural_secrets (cognitive 25) · ×1
  • secret_redact_posttool.structural_secrets (cognitive 25) internal/security/hooks/secret_redact_posttool.py:553 — secret_redact_posttool.structural_secrets has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 8, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMintUnenrollRepo (cognitive 24) · ×1
  • cli.runMintUnenrollRepo (cognitive 24) internal/cli/mint.go:1542 — cli.runMintUnenrollRepo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.newPollCmd (cognitive 24) · ×1
  • cli.newPollCmd (cognitive 24) internal/cli/poll.go:26 — cli.newPollCmd has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 47). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.agentsRepoHostTreeFetcher (cognitive 24) · ×1
  • cli.agentsRepoHostTreeFetcher (cognitive 24) internal/cli/run.go:8304 — cli.agentsRepoHostTreeFetcher has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 8309). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · gcf.bundleEmbeddedMintSource (cognitive 24) · ×1
  • gcf.bundleEmbeddedMintSource (cognitive 24) internal/dispatch/gcf/provisioner.go:2095 — gcf.bundleEmbeddedMintSource has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalmeasure.ScoreRunHealthNamed (cognitive 24) · ×1
  • evalmeasure.ScoreRunHealthNamed (cognitive 24) internal/evalmeasure/runhealth.go:41 — evalmeasure.ScoreRunHealthNamed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jira.walkInline (cognitive 24) · ×1
  • jira.walkInline (cognitive 24) internal/forge/jira/adf.go:582 — jira.walkInline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.buildEventPayload (cognitive 24) · ×1
  • poll.buildEventPayload (cognitive 24) internal/poll/dispatch.go:500 — poll.buildEventPayload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · repos.globalExecProblem (cognitive 24) · ×1
  • repos.globalExecProblem (cognitive 24) internal/repos/gitlab_trigger_jobs.go:348 — repos.globalExecProblem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.revokeUnsafeTriggerCredential (cognitive 24) · ×1
  • repos.revokeUnsafeTriggerCredential (cognitive 24) internal/repos/gitlab_webhook.go:1093 — repos.revokeUnsafeTriggerCredential has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.Uninstall (cognitive 24) · ×1
  • repos.Uninstall (cognitive 24) internal/repos/uninstall.go:231 — repos.Uninstall has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). Of this number, 15 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.removeAccount (cognitive 24) · ×1
  • gitLabTriggerAccountOp.removeAccount (cognitive 24) internal/repos/gitlab_trigger_account.go:2052 — gitLabTriggerAccountOp.removeAccount has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.maskRuntimeSecretLiterals (cognitive 24) · ×1
  • runtime.maskRuntimeSecretLiterals (cognitive 24) internal/runtime/progress_text.go:106 — runtime.maskRuntimeSecretLiterals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (11 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiRuntime.piExecModel (cognitive 24) · ×1
  • PiRuntime.piExecModel (cognitive 24) internal/runtime/pi_run.go:1056 — PiRuntime.piExecModel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 7, match/switch 1 (nesting depth added 1). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · steps.givenURLSourcedBaseHarness (cognitive 24) · ×1
  • steps.givenURLSourcedBaseHarness (cognitive 24) pkg/behaviourtest/steps/base_dispatch.go:73 — steps.givenURLSourcedBaseHarness has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · steps.commitLocalHarnessResources (cognitive 24) · ×1
  • steps.commitLocalHarnessResources (cognitive 24) pkg/behaviourtest/steps/dispatch.go:339 — steps.commitLocalHarnessResources has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ssrf_pretool._has_output_redirection (cognitive 24) · ×1
  • ssrf_pretool._has_output_redirection (cognitive 24) internal/security/hooks/ssrf_pretool.py:672 — ssrf_pretool._has_output_redirection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 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.
D2 · Cognitive Complexity · Setup.ensureInstalled (cognitive 23) · ×1
  • Setup.ensureInstalled (cognitive 23) internal/appsetup/appsetup.go:967 — Setup.ensureInstalled has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (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.
D2 · Cognitive Complexity · cli.repinSourceURL (cognitive 23) · ×1
  • cli.repinSourceURL (cognitive 23) internal/cli/agent.go:602 — cli.repinSourceURL has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (23 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newForeignListCmd (cognitive 23) · ×1
  • cli.newForeignListCmd (cognitive 23) internal/cli/foreign.go:121 — cli.newForeignListCmd has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (6 pts) (nesting depth added 7). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 127). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.setupGitLabPipelineSchedules (cognitive 23) · ×1
  • cli.setupGitLabPipelineSchedules (cognitive 23) internal/cli/repos_gitlab.go:64 — cli.setupGitLabPipelineSchedules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openAIReplyDoc.serviceAccountFor (cognitive 23) · ×1
  • openAIReplyDoc.serviceAccountFor (cognitive 23) internal/cli/inference_openai.go:519 — openAIReplyDoc.serviceAccountFor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (10 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.EffectiveYAML (cognitive 23) · ×1
  • config.EffectiveYAML (cognitive 23) internal/config/effective.go:20 — config.EffectiveYAML has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · config.ValidateGatewayCompat (cognitive 23) · ×1
  • config.ValidateGatewayCompat (cognitive 23) internal/config/inference_gateway.go:531 — config.ValidateGatewayCompat has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · LiveGCFClient.trySetIAMBinding (cognitive 23) · ×1
  • LiveGCFClient.trySetIAMBinding (cognitive 23) internal/dispatch/gcf/gcp.go:1001 — LiveGCFClient.trySetIAMBinding has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.GetIssueComment (cognitive 23) · ×1
  • LiveClient.GetIssueComment (cognitive 23) internal/forge/gitlab/issue.go:324 — LiveClient.GetIssueComment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 336). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TriggerOwner.resolveSuppliedAccounts (cognitive 23) · ×1
  • TriggerOwner.resolveSuppliedAccounts (cognitive 23) internal/gitlablifecycle/trigger_owner.go:307 — TriggerOwner.resolveSuppliedAccounts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitlabroles.registrationFromFile (cognitive 23) · ×1
  • gitlabroles.registrationFromFile (cognitive 23) internal/gitlabroles/registry.go:469 — gitlabroles.registrationFromFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.ValidateSkillOverrides (cognitive 23) · ×1
  • harness.ValidateSkillOverrides (cognitive 23) internal/harness/skill_entry.go:137 — harness.ValidateSkillOverrides has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (19 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.
D2 · Cognitive Complexity · Poller.resolveEventRoles (cognitive 23) · ×1
  • Poller.resolveEventRoles (cognitive 23) internal/jirapoll/auth.go:129 — Poller.resolveEventRoles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.commitScaffoldViaPR (cognitive 23) · ×1
  • layers.commitScaffoldViaPR (cognitive 23) internal/layers/commit.go:85 — layers.commitScaffoldViaPR has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (23 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.checkUnsyncedForkFallback (cognitive 23) · ×1
  • layers.checkUnsyncedForkFallback (cognitive 23) internal/layers/commit.go:518 — layers.checkUnsyncedForkFallback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.mergeLabelStateAgainst (cognitive 23) · ×1
  • poll.mergeLabelStateAgainst (cognitive 23) internal/poll/state.go:1644 — poll.mergeLabelStateAgainst has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (8 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.
D2 · Cognitive Complexity · Poller.applyPersistDeltas (cognitive 23) · ×1
  • Poller.applyPersistDeltas (cognitive 23) internal/poll/state.go:753 — Poller.applyPersistDeltas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Poller.persistWithCAS (cognitive 23) · ×1
  • Poller.persistWithCAS (cognitive 23) internal/poll/state.go:924 — Poller.persistWithCAS has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.BuildWebhookEvents (cognitive 23) · ×1
  • Poller.BuildWebhookEvents (cognitive 23) internal/poll/webhook.go:133 — Poller.BuildWebhookEvents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.webhookNoteEvents (cognitive 23) · ×1
  • Poller.webhookNoteEvents (cognitive 23) internal/poll/webhook.go:244 — Poller.webhookNoteEvents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · repos.revokeGitLabIdentityTokensSkipping (cognitive 23) · ×1
  • repos.revokeGitLabIdentityTokensSkipping (cognitive 23) internal/repos/gitlab_roles_cleanup.go:559 — repos.revokeGitLabIdentityTokensSkipping has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.RotateGitLabTriggerAccount (cognitive 23) · ×1
  • repos.RotateGitLabTriggerAccount (cognitive 23) internal/repos/gitlab_trigger_account.go:2209 — repos.RotateGitLabTriggerAccount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.CheckGitLabTriggerDispatchGate (cognitive 23) · ×1
  • repos.CheckGitLabTriggerDispatchGate (cognitive 23) internal/repos/gitlab_trigger_dispatch_gate.go:114 — repos.CheckGitLabTriggerDispatchGate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (23 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabTriggerProjectSafetyProblem (cognitive 23) · ×1
  • repos.gitlabTriggerProjectSafetyProblem (cognitive 23) internal/repos/gitlab_webhook.go:762 — repos.gitlabTriggerProjectSafetyProblem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · repos.mergeSpecInputs (cognitive 23) · ×1
  • repos.mergeSpecInputs (cognitive 23) internal/repos/gitlabci.go:1132 — repos.mergeSpecInputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.preflightManagedConfigRepos (cognitive 23) · ×1
  • repos.preflightManagedConfigRepos (cognitive 23) internal/repos/managed_config_writeback.go:210 — repos.preflightManagedConfigRepos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.valueNode (cognitive 23) · ×1
  • repos.valueNode (cognitive 23) internal/repos/manifest_set.go:728 — repos.valueNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.bootstrap (cognitive 23) · ×1
  • gitLabTriggerAccountOp.bootstrap (cognitive 23) internal/repos/gitlab_trigger_account.go:1706 — gitLabTriggerAccountOp.bootstrap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.extractRawContext (cognitive 23) · ×1
  • runtime.extractRawContext (cognitive 23) internal/runtime/claude_progress.go:720 — runtime.extractRawContext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeRuntime.Run (cognitive 23) · ×1
  • ClaudeRuntime.Run (cognitive 23) internal/runtime/claude.go:391 — ClaudeRuntime.Run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · sentencetoken.tokenizeWords (cognitive 23) · ×1
  • sentencetoken.tokenizeWords (cognitive 23) internal/sentencetoken/word.go:12 — sentencetoken.tokenizeWords has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.hasSupersedingAgentRun (cognitive 23) · ×1
  • Driver.hasSupersedingAgentRun (cognitive 23) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1584 — Driver.hasSupersedingAgentRun has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 6, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sharedOrgLock.leave (cognitive 23) · ×1
  • sharedOrgLock.leave (cognitive 23) pkg/behaviourtest/drivers/install/orglock.go:390 — sharedOrgLock.leave has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fullsend-codex-hook.run_script (cognitive 23) · ×1
  • fullsend-codex-hook.run_script (cognitive 23) internal/runtime/codex_hook/fullsend-codex-hook.py:505 — fullsend-codex-hook.run_script has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · unicode_posttool.scan_text (cognitive 23) · ×1
  • unicode_posttool.scan_text (cognitive 23) internal/security/hooks/unicode_posttool.py:117 — unicode_posttool.scan_text has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 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.
D2 · Cognitive Complexity · binary.ExtractFullsendFromTarGz (cognitive 22) · ×1
  • binary.ExtractFullsendFromTarGz (cognitive 22) internal/binary/download.go:357 — binary.ExtractFullsendFromTarGz has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 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.
D2 · Cognitive Complexity · cli.runAgentUpdate (cognitive 22) · ×1
  • cli.runAgentUpdate (cognitive 22) internal/cli/agent.go:512 — cli.runAgentUpdate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (22 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.runInferenceStatus (cognitive 22) · ×1
  • cli.runInferenceStatus (cognitive 22) internal/cli/inference.go:389 — cli.runInferenceStatus has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.validateGatewayHost (cognitive 22) · ×1
  • cli.validateGatewayHost (cognitive 22) internal/cli/run_gateway_egress.go:50 — cli.validateGatewayHost has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.Provision (cognitive 22) · ×1
  • Provisioner.Provision (cognitive 22) internal/dispatch/cf/provisioner.go:300 — Provisioner.Provision has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.validate (cognitive 22) · ×1
  • Provisioner.validate (cognitive 22) internal/dispatch/cf/provisioner.go:460 — Provisioner.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LiveGCFClient.UpdateServiceEnvVars (cognitive 22) · ×1
  • LiveGCFClient.UpdateServiceEnvVars (cognitive 22) internal/dispatch/gcf/gcp.go:1506 — LiveGCFClient.UpdateServiceEnvVars has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LiveClient.listDirContents (cognitive 22) · ×1
  • LiveClient.listDirContents (cognitive 22) REDACTED:2466 — LiveClient.listDirContents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.GetWorkflowRunLogs (cognitive 22) · ×1
  • LiveClient.GetWorkflowRunLogs (cognitive 22) REDACTED:5132 — LiveClient.GetWorkflowRunLogs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListDirectoryContents (cognitive 22) · ×1
  • LiveClient.ListDirectoryContents (cognitive 22) REDACTED:865 — LiveClient.ListDirectoryContents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
D2 · Cognitive Complexity · LiveClient.ListProjectServiceAccounts (cognitive 22) · ×1
  • LiveClient.ListProjectServiceAccounts (cognitive 22) internal/forge/gitlab/service_accounts.go:59 — LiveClient.ListProjectServiceAccounts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 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.
D2 · Cognitive Complexity · UninstallTokenClient.ReconcileGitLabPollersForUninstall (cognitive 22) · ×1
  • UninstallTokenClient.ReconcileGitLabPollersForUninstall (cognitive 22) internal/gitlablifecycle/uninstall.go:122 — UninstallTokenClient.ReconcileGitLabPollersForUninstall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Poller.resolveActorRoles (cognitive 22) · ×1
  • Poller.resolveActorRoles (cognitive 22) internal/jirapoll/poller.go:368 — Poller.resolveActorRoles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginformat.PiLoadProblem (cognitive 22) · ×1
  • pluginformat.PiLoadProblem (cognitive 22) internal/pluginformat/pi.go:163 — pluginformat.PiLoadProblem has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.detectNewLabels (cognitive 22) · ×1
  • Poller.detectNewLabels (cognitive 22) internal/poll/state.go:1764 — Poller.detectNewLabels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.checkGitHubJiraPollWorkflow (cognitive 22) · ×1
  • repos.checkGitHubJiraPollWorkflow (cognitive 22) internal/repos/github_jira_poll.go:36 — repos.checkGitHubJiraPollWorkflow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.prepareHandoffPollerOwnedTrigger (cognitive 22) · ×1
  • repos.prepareHandoffPollerOwnedTrigger (cognitive 22) internal/repos/gitlab_poller_cutover.go:39 — repos.prepareHandoffPollerOwnedTrigger has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.rotateProvided (cognitive 22) · ×1
  • repos.rotateProvided (cognitive 22) internal/repos/gitlab_roles_rotate.go:1055 — repos.rotateProvided has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (22 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · repos.gitlabDispatchConsumerProblem (cognitive 22) · ×1
  • repos.gitlabDispatchConsumerProblem (cognitive 22) internal/repos/gitlab_trigger_consumer.go:53 — repos.gitlabDispatchConsumerProblem has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.unevaluableRuleReason (cognitive 22) · ×1
  • repos.unevaluableRuleReason (cognitive 22) internal/repos/gitlab_workflow_admission.go:404 — repos.unevaluableRuleReason has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabWrapperForwardsDispatchInputs (cognitive 22) · ×1
  • repos.gitlabWrapperForwardsDispatchInputs (cognitive 22) internal/repos/gitlabci.go:1025 — repos.gitlabWrapperForwardsDispatchInputs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.Status (cognitive 22) · ×1
  • repos.Status (cognitive 22) internal/repos/status.go:186 — repos.Status has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 7). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.needsServiceAccountReplacement (cognitive 22) · ×1
  • ServiceAccountTokenClient.needsServiceAccountReplacement (cognitive 22) internal/repos/gitlab_service_account_converge.go:174 — ServiceAccountTokenClient.needsServiceAccountReplacement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResolvedConfig.applyEffectiveInfrastructure (cognitive 22) · ×1
  • ResolvedConfig.applyEffectiveInfrastructure (cognitive 22) internal/repos/infrastructure.go:81 — ResolvedConfig.applyEffectiveInfrastructure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve.resolveFileURL (cognitive 22) · ×1
  • resolve.resolveFileURL (cognitive 22) internal/resolve/resolve.go:567 — resolve.resolveFileURL has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (22 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · runtime.decodeCommentPath (cognitive 22) · ×1
  • runtime.decodeCommentPath (cognitive 22) REDACTED:451 — runtime.decodeCommentPath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · runtime.rejectDuplicateJSONKeys (cognitive 22) · ×1
  • runtime.rejectDuplicateJSONKeys (cognitive 22) internal/runtime/pi_gateway.go:286 — runtime.rejectDuplicateJSONKeys has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 290). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ClaudeRuntime.Bootstrap (cognitive 22) · ×1
  • ClaudeRuntime.Bootstrap (cognitive 22) internal/runtime/claude.go:98 — ClaudeRuntime.Bootstrap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CodexRuntime.foldCodexChildUsage (cognitive 22) · ×1
  • CodexRuntime.foldCodexChildUsage (cognitive 22) internal/runtime/codex_subagents.go:364 — CodexRuntime.foldCodexChildUsage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · progressReconciler.status (cognitive 22) · ×1
  • progressReconciler.status (cognitive 22) internal/runtime/status_progress.go:15 — progressReconciler.status has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sticky.BuildUpdatedBody (cognitive 22) · ×1
  • sticky.BuildUpdatedBody (cognitive 22) internal/sticky/sticky.go:222 — sticky.BuildUpdatedBody has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4, boolean chains 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · artifacts.FindOutputFilesByArtifact (cognitive 22) · ×1
  • artifacts.FindOutputFilesByArtifact (cognitive 22) pkg/behaviourtest/artifacts/find.go:43 — artifacts.FindOutputFilesByArtifact has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 49, 90). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Driver.emptyMatrixPollOnce (cognitive 22) · ×1
  • Driver.emptyMatrixPollOnce (cognitive 22) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1944 — Driver.emptyMatrixPollOnce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · composedDriver.Finalize (cognitive 22) · ×1
  • composedDriver.Finalize (cognitive 22) REDACTED:731 — composedDriver.Finalize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (5 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.thenPublishedRepoMatchesFixture (cognitive 22) · ×1
  • steps.thenPublishedRepoMatchesFixture (cognitive 22) pkg/behaviourtest/steps/playback.go:788 — steps.thenPublishedRepoMatchesFixture has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.givenRepositoryAgentSettings (cognitive 22) · ×1
  • steps.givenRepositoryAgentSettings (cognitive 22) pkg/behaviourtest/steps/runtime.go:204 — steps.givenRepositoryAgentSettings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript.normalize_pi_message (cognitive 22) · ×1
  • analyze-transcript.normalize_pi_message (cognitive 22) skills/analyze-transcript/analyze-transcript.py:153 — analyze-transcript.normalize_pi_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · GhFetcher._pulls_for_linking (cognitive 22) · ×1
  • GhFetcher._pulls_for_linking (cognitive 22) skills/nextwork/scripts/nextwork.py:1745 — GhFetcher._pulls_for_linking has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · cli.newForeignAllowCmd (cognitive 21) · ×1
  • cli.newForeignAllowCmd (cognitive 21) internal/cli/foreign.go:35 — cli.newForeignAllowCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 40). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.convergeGitLabDispatchRoute (cognitive 21) · ×1
  • cli.convergeGitLabDispatchRoute (cognitive 21) internal/cli/repos_gitlab_trigger_account.go:168 — cli.convergeGitLabDispatchRoute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.fetchPinnedAgentsRepoFile (cognitive 21) · ×1
  • cli.fetchPinnedAgentsRepoFile (cognitive 21) internal/cli/run.go:8017 — cli.fetchPinnedAgentsRepoFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · config.decodeManagedConfig (cognitive 21) · ×1
  • config.decodeManagedConfig (cognitive 21) internal/config/managed.go:204 — config.decodeManagedConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveGCFClient.GetServiceTrafficEnvVars (cognitive 21) · ×1
  • LiveGCFClient.GetServiceTrafficEnvVars (cognitive 21) internal/dispatch/gcf/gcp.go:1700 — LiveGCFClient.GetServiceTrafficEnvVars has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FakeClient.ListPullRequestFileDiffs (cognitive 21) · ×1
  • FakeClient.ListPullRequestFileDiffs (cognitive 21) REDACTED:2114 — FakeClient.ListPullRequestFileDiffs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (8 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LiveClient.ListRepoPullRequests (cognitive 21) · ×1
  • LiveClient.ListRepoPullRequests (cognitive 21) internal/forge/gitlab/mr.go:102 — LiveClient.ListRepoPullRequests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.resolveRootCommitSHA (cognitive 21) · ×1
  • LiveClient.resolveRootCommitSHA (cognitive 21) REDACTED:1069 — LiveClient.resolveRootCommitSHA has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jira.escapeMDLineStarts (cognitive 21) · ×1
  • jira.escapeMDLineStarts (cognitive 21) internal/forge/jira/adf.go:1453 — jira.escapeMDLineStarts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TriggerOwner.pollerUserIDs (cognitive 21) · ×1
  • TriggerOwner.pollerUserIDs (cognitive 21) internal/gitlablifecycle/trigger_owner.go:582 — TriggerOwner.pollerUserIDs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Registry.add (cognitive 21) · ×1
  • Registry.add (cognitive 21) internal/gitlabroles/registry.go:373 — Registry.add has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.fetchBaseFileFromPinnedTree (cognitive 21) · ×1
  • harness.fetchBaseFileFromPinnedTree (cognitive 21) internal/harness/compose.go:1921 — harness.fetchBaseFileFromPinnedTree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 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.
D2 · Cognitive Complexity · harness.mergeForgeConfig (cognitive 21) · ×1
  • harness.mergeForgeConfig (cognitive 21) internal/harness/forge.go:377 — harness.mergeForgeConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Harness.Lint (cognitive 21) · ×1
  • Harness.Lint (cognitive 21) internal/harness/lint.go:85 — Harness.Lint has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · vertexauth.prepareGitHubWIF (cognitive 21) · ×1
  • vertexauth.prepareGitHubWIF (cognitive 21) internal/inference/vertexauth/vertexauth.go:83 — vertexauth.prepareGitHubWIF has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Poller.processIssue (cognitive 21) · ×1
  • Poller.processIssue (cognitive 21) internal/jirapoll/poller.go:468 — Poller.processIssue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.encodeJiraEventPayload (cognitive 21) · ×1
  • poll.encodeJiraEventPayload (cognitive 21) internal/poll/jira_dispatch.go:203 — poll.encodeJiraEventPayload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · prescript.ParseFile (cognitive 21) · ×1
  • prescript.ParseFile (cognitive 21) internal/prescript/prescript.go:133 — prescript.ParseFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.rejectDuplicateJSONKeys (cognitive 21) · ×1
  • repos.rejectDuplicateJSONKeys (cognitive 21) internal/repos/gitlab_poller_generation.go:182 — repos.rejectDuplicateJSONKeys has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.GitLabWebhookTriggerRouteStale (cognitive 21) · ×1
  • repos.GitLabWebhookTriggerRouteStale (cognitive 21) internal/repos/gitlab_webhook_trigger_account.go:410 — repos.GitLabWebhookTriggerRouteStale has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (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.
D2 · Cognitive Complexity · repos.gitlabRootDeclaresDispatchInputs (cognitive 21) · ×1
  • repos.gitlabRootDeclaresDispatchInputs (cognitive 21) internal/repos/gitlabci.go:800 — repos.gitlabRootDeclaresDispatchInputs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · repos.applyStaleVendoredPlan (cognitive 21) · ×1
  • repos.applyStaleVendoredPlan (cognitive 21) internal/repos/stale_vendored.go:301 — repos.applyStaleVendoredPlan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceAccountTokenClient.containOwnedRole (cognitive 21) · ×1
  • ServiceAccountTokenClient.containOwnedRole (cognitive 21) internal/repos/gitlab_service_account_converge.go:690 — ServiceAccountTokenClient.containOwnedRole has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.removeProtectedRefResources (cognitive 21) · ×1
  • gitLabTriggerAccountOp.removeProtectedRefResources (cognitive 21) internal/repos/gitlab_trigger_account.go:1992 — gitLabTriggerAccountOp.removeProtectedRefResources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (21 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Envelope.validate (cognitive 21) · ×1
  • Envelope.validate (cognitive 21) internal/telemetry/tracecontext/envelope.go:129 — Envelope.validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · retryselect.Select (cognitive 21) · ×1
  • retryselect.Select (cognitive 21) pkg/behaviourtest/retryselect/retryselect.go:66 — retryselect.Select has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.waitForMintProbeRun (cognitive 21) · ×1
  • steps.waitForMintProbeRun (cognitive 21) pkg/behaviourtest/steps/mint_probe.go:589 — steps.waitForMintProbeRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3, boolean chains 2 (nesting depth added 7). Of this number, 14 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mintcore.mintHTTP (cognitive 21) · ×1
  • mintcore.mintHTTP (cognitive 21) internal/mintcore/http_client.go:25 — mintcore.mintHTTP has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · secret_redact_posttool.content_skips (cognitive 21) · ×1
  • secret_redact_posttool.content_skips (cognitive 21) internal/security/hooks/secret_redact_posttool.py:177 — secret_redact_posttool.content_skips has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, error handling 2 (3 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · secret_redact_posttool._credential_like (cognitive 21) · ×1
  • secret_redact_posttool._credential_like (cognitive 21) internal/security/hooks/secret_redact_posttool.py:475 — secret_redact_posttool._credential_like has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Setup.handleExistingApp (cognitive 20) · ×1
  • Setup.handleExistingApp (cognitive 20) internal/appsetup/appsetup.go:557 — Setup.handleExistingApp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.artifactRunSource (cognitive 20) · ×1
  • cli.artifactRunSource (cognitive 20) internal/cli/prepareartifacts.go:186 — cli.artifactRunSource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.loadRunConfig (cognitive 20) · ×1
  • cli.loadRunConfig (cognitive 20) internal/cli/run.go:319 — cli.loadRunConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveGCFClient.CreateWIFProvider (cognitive 20) · ×1
  • LiveGCFClient.CreateWIFProvider (cognitive 20) internal/dispatch/gcf/gcp.go:368 — LiveGCFClient.CreateWIFProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetch.CacheFindNewest (cognitive 20) · ×1
  • fetch.CacheFindNewest (cognitive 20) internal/fetch/cache.go:165 — fetch.CacheFindNewest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.GetRawFileContentAtRef (cognitive 20) · ×1
  • LiveClient.GetRawFileContentAtRef (cognitive 20) REDACTED:2368 — LiveClient.GetRawFileContentAtRef has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LiveClient.ListInheritedRepoVariables (cognitive 20) · ×1
  • LiveClient.ListInheritedRepoVariables (cognitive 20) internal/forge/gitlab/ci.go:578 — LiveClient.ListInheritedRepoVariables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 2 (nesting depth added 6). Of this number, 13 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.resolveBaseForgeAndOverlays (cognitive 20) · ×1
  • harness.resolveBaseForgeAndOverlays (cognitive 20) internal/harness/compose.go:685 — harness.resolveBaseForgeAndOverlays has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 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.
D2 · Cognitive Complexity · harness.mergeSkills (cognitive 20) · ×1
  • harness.mergeSkills (cognitive 20) internal/harness/compose.go:2690 — harness.mergeSkills has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.HasURLReferences (cognitive 20) · ×1
  • Harness.HasURLReferences (cognitive 20) REDACTED:1332 — Harness.HasURLReferences has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (6 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.
D2 · Cognitive Complexity · Poller.discoverSlashCommands (cognitive 20) · ×1
  • Poller.discoverSlashCommands (cognitive 20) internal/poll/events.go:454 — Poller.discoverSlashCommands has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.revalidateReconcile (cognitive 20) · ×1
  • Poller.revalidateReconcile (cognitive 20) internal/poll/state.go:1022 — Poller.revalidateReconcile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3, 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.
D2 · Cognitive Complexity · repos.finalizePendingPollerCutover (cognitive 20) · ×1
  • repos.finalizePendingPollerCutover (cognitive 20) internal/repos/gitlab_poller_cutover.go:252 — repos.finalizePendingPollerCutover has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.revokeRetiringPollerTriggers (cognitive 20) · ×1
  • repos.revokeRetiringPollerTriggers (cognitive 20) internal/repos/gitlab_poller_retirement.go:219 — repos.revokeRetiringPollerTriggers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabIncludeAdmits (cognitive 20) · ×1
  • repos.gitlabIncludeAdmits (cognitive 20) internal/repos/gitlab_trigger_consumer.go:246 — repos.gitlabIncludeAdmits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.jobExecSurfaceProblem (cognitive 20) · ×1
  • repos.jobExecSurfaceProblem (cognitive 20) internal/repos/gitlab_trigger_jobs.go:435 — repos.jobExecSurfaceProblem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabInheritedVariableScan (cognitive 20) · ×1
  • repos.gitlabInheritedVariableScan (cognitive 20) internal/repos/gitlab_variable_scopes.go:38 — repos.gitlabInheritedVariableScan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 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.
D2 · Cognitive Complexity · repos.verifyGitLabWebhookActiveToken (cognitive 20) · ×1
  • repos.verifyGitLabWebhookActiveToken (cognitive 20) internal/repos/gitlab_webhook.go:2474 — repos.verifyGitLabWebhookActiveToken has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.GitLabWebhookUsesRetiredTriggerCredential (cognitive 20) · ×1
  • repos.GitLabWebhookUsesRetiredTriggerCredential (cognitive 20) internal/repos/gitlab_webhook_trigger_account.go:145 — repos.GitLabWebhookUsesRetiredTriggerCredential has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.mergeGitLabCIWithWrapper (cognitive 20) · ×1
  • repos.mergeGitLabCIWithWrapper (cognitive 20) internal/repos/gitlabci.go:554 — repos.mergeGitLabCIWithWrapper has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.checkManagedConfigDrift (cognitive 20) · ×1
  • repos.checkManagedConfigDrift (cognitive 20) internal/repos/managed_config_lifecycle.go:205 — repos.checkManagedConfigDrift has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.carveOutGlobEntry (cognitive 20) · ×1
  • repos.carveOutGlobEntry (cognitive 20) internal/repos/manifest_edit.go:57 — repos.carveOutGlobEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ProbeRepoState (cognitive 20) · ×1
  • repos.ProbeRepoState (cognitive 20) internal/repos/status.go:30 — repos.ProbeRepoState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · ServiceAccountTokenClient.ConfirmOutgoingTokenInactive (cognitive 20) · ×1
  • ServiceAccountTokenClient.ConfirmOutgoingTokenInactive (cognitive 20) internal/repos/gitlab_service_accounts.go:1064 — ServiceAccountTokenClient.ConfirmOutgoingTokenInactive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.containBySinkState (cognitive 20) · ×1
  • gitLabTriggerAccountOp.containBySinkState (cognitive 20) internal/repos/gitlab_trigger_account.go:1061 — gitLabTriggerAccountOp.containBySinkState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.liveDrift (cognitive 20) · ×1
  • gitLabTriggerAccountOp.liveDrift (cognitive 20) internal/repos/gitlab_trigger_account_status.go:292 — gitLabTriggerAccountOp.liveDrift has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · resolve.resolveSkillTransitiveDeps (cognitive 20) · ×1
  • resolve.resolveSkillTransitiveDeps (cognitive 20) internal/resolve/resolve.go:813 — resolve.resolveSkillTransitiveDeps 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.
D2 · Cognitive Complexity · runtime.codexTOMLBasicString (cognitive 20) · ×1
  • runtime.codexTOMLBasicString (cognitive 20) internal/runtime/codex_config.go:300 — runtime.codexTOMLBasicString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.piChildSpecResolver (cognitive 20) · ×1
  • runtime.piChildSpecResolver (cognitive 20) internal/runtime/pi_personas.go:401 — runtime.piChildSpecResolver has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3, boolean chains 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tokenBasedAnnotation.tokenAnnotation (cognitive 20) · ×1
  • tokenBasedAnnotation.tokenAnnotation (cognitive 20) internal/sentencetoken/annotate.go:55 — tokenBasedAnnotation.tokenAnnotation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.buildPoolDriver (cognitive 20) · ×1
  • install.buildPoolDriver (cognitive 20) REDACTED:315 — install.buildPoolDriver has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (nesting depth added 7). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 323, 353). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · steps.ensureRunArtifacts (cognitive 20) · ×1
  • steps.ensureRunArtifacts (cognitive 20) pkg/behaviourtest/steps/artifacts.go:57 — steps.ensureRunArtifacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · adr_corner.infer_adr_authors (cognitive 20) · ×1
  • adr_corner.infer_adr_authors (cognitive 20) skills/adr-corner/scripts/adr_corner.py:269 — adr_corner.infer_adr_authors has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, loops 6 (8 pts), if/else 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript._check_block_error (cognitive 20) · ×1
  • analyze-transcript._check_block_error (cognitive 20) skills/analyze-transcript/analyze-transcript.py:502 — analyze-transcript._check_block_error has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GhFetcher.is_in_merge_queue (cognitive 20) · ×1
  • GhFetcher.is_in_merge_queue (cognitive 20) skills/nextwork/scripts/nextwork.py:1798 — GhFetcher.is_in_merge_queue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.newInferenceProvisionCmd (cognitive 19) · ×1
  • cli.newInferenceProvisionCmd (cognitive 19) internal/cli/inference.go:67 — cli.newInferenceProvisionCmd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 5). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 111). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.newPostReviewCmd (cognitive 19) · ×1
  • cli.newPostReviewCmd (cognitive 19) REDACTED:71 — cli.newPostReviewCmd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2 (nesting depth added 3). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 114). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.maybeRotateGitLabRoles (cognitive 19) · ×1
  • cli.maybeRotateGitLabRoles (cognitive 19) internal/cli/repos_gitlab.go:578 — cli.maybeRotateGitLabRoles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalmeasure.costToolsTurnsDetail (cognitive 19) · ×1
  • evalmeasure.costToolsTurnsDetail (cognitive 19) internal/evalmeasure/fitness.go:221 — evalmeasure.costToolsTurnsDetail has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListProjectActiveJobs (cognitive 19) · ×1
  • LiveClient.ListProjectActiveJobs (cognitive 19) internal/forge/gitlab/service_accounts.go:327 — LiveClient.ListProjectActiveJobs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 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. This shape REPEATS in the file: one other method here (LiveClient.ListProjectPipelineSchedules) 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.
D2 · Cognitive Complexity · LiveClient.ListProjectPipelineSchedules (cognitive 19) · ×1
  • LiveClient.ListProjectPipelineSchedules (cognitive 19) internal/forge/gitlab/service_accounts.go:379 — LiveClient.ListProjectPipelineSchedules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 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. This shape REPEATS in the file: one other method here (LiveClient.ListProjectActiveJobs) 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.
D2 · Cognitive Complexity · gitlabroles.CheckRegisteredReadiness (cognitive 19) · ×1
  • gitlabroles.CheckRegisteredReadiness (cognitive 19) internal/gitlabroles/readiness.go:96 — gitlabroles.CheckRegisteredReadiness has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 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.
D2 · Cognitive Complexity · Registry.resolveReuse (cognitive 19) · ×1
  • Registry.resolveReuse (cognitive 19) internal/gitlabroles/registry.go:437 — Registry.resolveReuse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 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.
D2 · Cognitive Complexity · harness.fetchBaseScriptDirTree (cognitive 19) · ×1
  • harness.fetchBaseScriptDirTree (cognitive 19) internal/harness/compose.go:2094 — harness.fetchBaseScriptDirTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (19 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · EnvConfig.mergeEnvFrom (cognitive 19) · ×1
  • EnvConfig.mergeEnvFrom (cognitive 19) REDACTED:345 — EnvConfig.mergeEnvFrom has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.commitViaPR (cognitive 19) · ×1
  • layers.commitViaPR (cognitive 19) internal/layers/commit.go:663 — layers.commitViaPR has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginformat.extensionAutoEntries (cognitive 19) · ×1
  • pluginformat.extensionAutoEntries (cognitive 19) internal/pluginformat/pi.go:397 — pluginformat.extensionAutoEntries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.mirrorFailureCount (cognitive 19) · ×1
  • poll.mirrorFailureCount (cognitive 19) internal/poll/legacy_mirror.go:210 — poll.mirrorFailureCount has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.webhookIssueEvents (cognitive 19) · ×1
  • Poller.webhookIssueEvents (cognitive 19) internal/poll/webhook.go:418 — Poller.webhookIssueEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.cutOverPollerGeneration (cognitive 19) · ×1
  • repos.cutOverPollerGeneration (cognitive 19) internal/repos/gitlab_poller_cutover.go:406 — repos.cutOverPollerGeneration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, loops 2, match/switch 1 (nesting depth added 1). 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: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · repos.gitlabDispatchRouteScaffoldProblem (cognitive 19) · ×1
  • repos.gitlabDispatchRouteScaffoldProblem (cognitive 19) internal/repos/gitlab_trigger_dispatch_gate.go:341 — repos.gitlabDispatchRouteScaffoldProblem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
D2 · Cognitive Complexity · repos.gitlabManagedSourceAdmissionProblem (cognitive 19) · ×1
  • repos.gitlabManagedSourceAdmissionProblem (cognitive 19) internal/repos/gitlab_trigger_dispatch_gate.go:454 — repos.gitlabManagedSourceAdmissionProblem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ConvergeGitLabTriggerSchedules (cognitive 19) · ×1
  • repos.ConvergeGitLabTriggerSchedules (cognitive 19) internal/repos/gitlab_trigger_schedules.go:100 — repos.ConvergeGitLabTriggerSchedules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · repos.gitlabEffectiveWorkflowProblemForEnv (cognitive 19) · ×1
  • repos.gitlabEffectiveWorkflowProblemForEnv (cognitive 19) internal/repos/gitlab_webhook.go:1633 — repos.gitlabEffectiveWorkflowProblemForEnv has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.mergeWorkflowRules (cognitive 19) · ×1
  • repos.mergeWorkflowRules (cognitive 19) internal/repos/gitlabci.go:1678 — repos.mergeWorkflowRules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · suppliedPollerGrantProbe.rollback (cognitive 19) · ×1
  • suppliedPollerGrantProbe.rollback (cognitive 19) internal/repos/gitlab_supplied_provenance.go:526 — suppliedPollerGrantProbe.rollback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · runtime.validateOpenCodePermissionPolicy (cognitive 19) · ×1
  • runtime.validateOpenCodePermissionPolicy (cognitive 19) internal/runtime/opencode_integrity.go:108 — runtime.validateOpenCodePermissionPolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiRuntime.ExtractTranscripts (cognitive 19) · ×1
  • PiRuntime.ExtractTranscripts (cognitive 19) internal/runtime/pi_transcript.go:58 — PiRuntime.ExtractTranscripts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tracker.transitionFields (cognitive 19) · ×1
  • tracker.transitionFields (cognitive 19) internal/tracker/transition.go:156 — tracker.transitionFields has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.RunGitHubSetupWithOpts (cognitive 19) · ×1
  • common.RunGitHubSetupWithOpts (cognitive 19) pkg/behaviourtest/drivers/install/common/setup.go:72 — common.RunGitHubSetupWithOpts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · repoEnsurer.doEnsure (cognitive 19) · ×1
  • repoEnsurer.doEnsure (cognitive 19) pkg/behaviourtest/drivers/install/ensure.go:360 — repoEnsurer.doEnsure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (19 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · slotAllocator.reclaimSlot (cognitive 19) · ×1
  • slotAllocator.reclaimSlot (cognitive 19) pkg/behaviourtest/drivers/install/slotgc.go:477 — slotAllocator.reclaimSlot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, match/switch 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · suite.afterScenario (cognitive 19) · ×1
  • suite.afterScenario (cognitive 19) pkg/behaviourtest/suite/init.go:117 — suite.afterScenario has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4 (nesting depth added 6). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 125). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Handler.resolveBotRole (cognitive 19) · ×1
  • Handler.resolveBotRole (cognitive 19) internal/mintcore/bot_role.go:164 — Handler.resolveBotRole has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 pts) (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.lookupInstallation (cognitive 19) · ×1
  • Handler.lookupInstallation (cognitive 19) internal/mintcore/handler.go:590 — Handler.lookupInstallation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hook_io.apply_text (cognitive 19) · ×1
  • hook_io.apply_text (cognitive 19) internal/security/hooks/hook_io.py:112 — hook_io.apply_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ssrf_pretool.validate_url (cognitive 19) · ×1
  • ssrf_pretool.validate_url (cognitive 19) internal/security/hooks/ssrf_pretool.py:462 — ssrf_pretool.validate_url has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 3, boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ssrf_pretool._is_in_text_pattern_context (cognitive 19) · ×1
  • ssrf_pretool._is_in_text_pattern_context (cognitive 19) internal/security/hooks/ssrf_pretool.py:737 — ssrf_pretool._is_in_text_pattern_context has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript.cmd_search (cognitive 19) · ×1
  • analyze-transcript.cmd_search (cognitive 19) skills/analyze-transcript/analyze-transcript.py:624 — analyze-transcript.cmd_search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 1 (4 pts), loops 2 (3 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.
D2 · Cognitive Complexity · nextwork.resolve_threads (cognitive 19) · ×1
  • nextwork.resolve_threads (cognitive 19) skills/nextwork/scripts/nextwork.py:2273 — nextwork.resolve_threads has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · agentnew.ExpandTrigger (cognitive 18) · ×1
  • agentnew.ExpandTrigger (cognitive 18) internal/agentnew/trigger.go:51 — agentnew.ExpandTrigger has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
D2 · Cognitive Complexity · Setup.recoverPEM (cognitive 18) · ×1
  • Setup.recoverPEM (cognitive 18) internal/appsetup/appsetup.go:446 — Setup.recoverPEM has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 1 (nesting depth added 4). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.evalMeasureFetchContext (cognitive 18) · ×1
  • cli.evalMeasureFetchContext (cognitive 18) internal/cli/evalmeasure.go:207 — cli.evalMeasureFetchContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.newInferenceOpenAIRequestCmd (cognitive 18) · ×1
  • cli.newInferenceOpenAIRequestCmd (cognitive 18) internal/cli/inference_openai.go:117 — cli.newInferenceOpenAIRequestCmd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 140). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.resolveImportIDs (cognitive 18) · ×1
  • cli.resolveImportIDs (cognitive 18) internal/cli/inference_openai.go:625 — cli.resolveImportIDs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runInferenceOpenAIStatus (cognitive 18) · ×1
  • cli.runInferenceOpenAIStatus (cognitive 18) internal/cli/inference_openai.go:923 — cli.runInferenceOpenAIStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
D2 · Cognitive Complexity · cli.selectLintAgent (cognitive 18) · ×1
  • cli.selectLintAgent (cognitive 18) internal/cli/lint.go:459 — cli.selectLintAgent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newMintDeployCmd (cognitive 18) · ×1
  • cli.newMintDeployCmd (cognitive 18) internal/cli/mint.go:418 — cli.newMintDeployCmd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 591). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.postReviewContent (cognitive 18) · ×1
  • cli.postReviewContent (cognitive 18) REDACTED:368 — cli.postReviewContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.setupActionsVertexCredentials (cognitive 18) · ×1
  • cli.setupActionsVertexCredentials (cognitive 18) internal/cli/run.go:5575 — cli.setupActionsVertexCredentials has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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.
D2 · Cognitive Complexity · cli.scanOutputFiles (cognitive 18) · ×1
  • cli.scanOutputFiles (cognitive 18) internal/cli/run.go:6756 — cli.scanOutputFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 6766). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.loadRunnerSecrets (cognitive 18) · ×1
  • cli.loadRunnerSecrets (cognitive 18) internal/cli/runner_secrets.go:146 — cli.loadRunnerSecrets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.trustedTirithRepoPolicy (cognitive 18) · ×1
  • cli.trustedTirithRepoPolicy (cognitive 18) internal/cli/tirith_repo_policy.go:117 — cli.trustedTirithRepoPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InferenceGatewayConfig.Validate (cognitive 18) · ×1
  • InferenceGatewayConfig.Validate (cognitive 18) internal/config/inference_gateway.go:201 — InferenceGatewayConfig.Validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JiraTrackingConfig.UnmarshalYAML (cognitive 18) · ×1
  • JiraTrackingConfig.UnmarshalYAML (cognitive 18) internal/config/issue_targets.go:161 — JiraTrackingConfig.UnmarshalYAML has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveGCFClient.waitForIAMOperation (cognitive 18) · ×1
  • LiveGCFClient.waitForIAMOperation (cognitive 18) internal/dispatch/gcf/gcp.go:2097 — LiveGCFClient.waitForIAMOperation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.ProvisionGitLabWIF (cognitive 18) · ×1
  • Provisioner.ProvisionGitLabWIF (cognitive 18) internal/dispatch/gcf/gitlab_wif.go:178 — Provisioner.ProvisionGitLabWIF has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.ProvisionWIF (cognitive 18) · ×1
  • Provisioner.ProvisionWIF (cognitive 18) internal/dispatch/gcf/provisioner.go:1618 — Provisioner.ProvisionWIF has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.CreateForkInOrg (cognitive 18) · ×1
  • LiveClient.CreateForkInOrg (cognitive 18) REDACTED:1396 — LiveClient.CreateForkInOrg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (18 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.listVariableNames (cognitive 18) · ×1
  • LiveClient.listVariableNames (cognitive 18) internal/forge/gitlab/ci.go:665 — LiveClient.listVariableNames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 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.
D2 · Cognitive Complexity · LiveClient.ListWorkflowRunsSince (cognitive 18) · ×1
  • LiveClient.ListWorkflowRunsSince (cognitive 18) internal/forge/gitlab/ci.go:853 — LiveClient.ListWorkflowRunsSince has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.GetWorkflowRunLogs (cognitive 18) · ×1
  • LiveClient.GetWorkflowRunLogs (cognitive 18) internal/forge/gitlab/ci.go:1064 — LiveClient.GetWorkflowRunLogs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPipelineTriggerTokens (cognitive 18) · ×1
  • LiveClient.ListPipelineTriggerTokens (cognitive 18) internal/forge/gitlab/hooks.go:56 — LiveClient.ListPipelineTriggerTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 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.
D2 · Cognitive Complexity · LiveClient.ListPullRequestFileDiffs (cognitive 18) · ×1
  • LiveClient.ListPullRequestFileDiffs (cognitive 18) internal/forge/gitlab/mr.go:345 — LiveClient.ListPullRequestFileDiffs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPullRequestReviews (cognitive 18) · ×1
  • LiveClient.ListPullRequestReviews (cognitive 18) internal/forge/gitlab/mr.go:758 — LiveClient.ListPullRequestReviews has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.collectTreeDirEntries (cognitive 18) · ×1
  • LiveClient.collectTreeDirEntries (cognitive 18) REDACTED:113 — LiveClient.collectTreeDirEntries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jira.tryDetailsExpand (cognitive 18) · ×1
  • jira.tryDetailsExpand (cognitive 18) internal/forge/jira/adf.go:170 — jira.tryDetailsExpand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jira.convertBlockNode (cognitive 18) · ×1
  • jira.convertBlockNode (cognitive 18) internal/forge/jira/adf.go:340 — jira.convertBlockNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · harness.fetchBaseURL (cognitive 18) · ×1
  • harness.fetchBaseURL (cognitive 18) internal/harness/compose.go:744 — harness.fetchBaseURL has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillEntry.UnmarshalYAML (cognitive 18) · ×1
  • SkillEntry.UnmarshalYAML (cognitive 18) internal/harness/skill_entry.go:42 — SkillEntry.UnmarshalYAML has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
D2 · Cognitive Complexity · input.mapGitHubWebhook (cognitive 18) · ×1
  • input.mapGitHubWebhook (cognitive 18) internal/harnessdispatch/input/ghaevent.go:68 — input.mapGitHubWebhook has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginformat.extensionManifest (cognitive 18) · ×1
  • pluginformat.extensionManifest (cognitive 18) internal/pluginformat/pi.go:227 — pluginformat.extensionManifest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · poll.SeedGitLabPollStateBranches (cognitive 18) · ×1
  • poll.SeedGitLabPollStateBranches (cognitive 18) internal/poll/state.go:1988 — poll.SeedGitLabPollStateBranches 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.
D2 · Cognitive Complexity · Poller.webhookIssueLabelEvents (cognitive 18) · ×1
  • Poller.webhookIssueLabelEvents (cognitive 18) internal/poll/webhook.go:499 — Poller.webhookIssueLabelEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.checkPresetDrift (cognitive 18) · ×1
  • repos.checkPresetDrift (cognitive 18) internal/repos/config_preset.go:244 — repos.checkPresetDrift has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
D2 · Cognitive Complexity · repos.requireGitLabVariableFreeSchedules (cognitive 18) · ×1
  • repos.requireGitLabVariableFreeSchedules (cognitive 18) internal/repos/gitlab_pipeline_var_restriction.go:273 — repos.requireGitLabVariableFreeSchedules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 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.
D2 · Cognitive Complexity · repos.VerifyGitLabPollerCredentials (cognitive 18) · ×1
  • repos.VerifyGitLabPollerCredentials (cognitive 18) internal/repos/gitlab_poller_credential_policy.go:37 — repos.VerifyGitLabPollerCredentials has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.currentWebhookTriggerEvidence (cognitive 18) · ×1
  • repos.currentWebhookTriggerEvidence (cognitive 18) internal/repos/gitlab_poller_retirement.go:282 — repos.currentWebhookTriggerEvidence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 283). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · repos.extraGitLabRoleUninstallVars (cognitive 18) · ×1
  • repos.extraGitLabRoleUninstallVars (cognitive 18) internal/repos/gitlab_roles.go:764 — repos.extraGitLabRoleUninstallVars has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 4). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · repos.gitlabJobRunsShippedScript (cognitive 18) · ×1
  • repos.gitlabJobRunsShippedScript (cognitive 18) internal/repos/gitlab_trigger_dispatch_gate.go:736 — repos.gitlabJobRunsShippedScript has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.unknownFieldError (cognitive 18) · ×1
  • repos.unknownFieldError (cognitive 18) internal/repos/manifest_set.go:681 — repos.unknownFieldError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.filterRepos (cognitive 18) · ×1
  • repos.filterRepos (cognitive 18) internal/repos/status.go:715 — repos.filterRepos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mergeLookup.findInMergeSources (cognitive 18) · ×1
  • mergeLookup.findInMergeSources (cognitive 18) internal/repos/gitlab_webhook.go:1499 — mergeLookup.findInMergeSources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.piToolContext (cognitive 18) · ×1
  • runtime.piToolContext (cognitive 18) internal/runtime/pi_progress.go:124 — runtime.piToolContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenCodeRuntime.Bootstrap (cognitive 18) · ×1
  • OpenCodeRuntime.Bootstrap (cognitive 18) internal/runtime/opencode_bootstrap.go:65 — OpenCodeRuntime.Bootstrap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · slotAllocator.collectOrg (cognitive 18) · ×1
  • slotAllocator.collectOrg (cognitive 18) pkg/behaviourtest/drivers/install/slotgc.go:294 — slotAllocator.collectOrg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.thenHarnessWorkflowFailsReporting (cognitive 18) · ×1
  • steps.thenHarnessWorkflowFailsReporting (cognitive 18) pkg/behaviourtest/steps/branch.go:271 — steps.thenHarnessWorkflowFailsReporting has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.givenIssueFromFixture (cognitive 18) · ×1
  • steps.givenIssueFromFixture (cognitive 18) pkg/behaviourtest/steps/playback.go:88 — steps.givenIssueFromFixture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · graceBudget.grant (cognitive 18) · ×1
  • graceBudget.grant (cognitive 18) pkg/behaviourtest/steps/debuglogs.go:131 — graceBudget.grant has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mintcore.NewTracer (cognitive 18) · ×1
  • mintcore.NewTracer (cognitive 18) internal/mintcore/tracing.go:140 — mintcore.NewTracer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.harnessDeclaresOpenAIProvider (cognitive 17) · ×1
  • cli.harnessDeclaresOpenAIProvider (cognitive 17) internal/cli/agent_openai.go:111 — cli.harnessDeclaresOpenAIProvider has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.listRepoForeign (cognitive 17) · ×1
  • cli.listRepoForeign (cognitive 17) internal/cli/foreign.go:211 — cli.listRepoForeign has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.resolveForeignTarget (cognitive 17) · ×1
  • cli.resolveForeignTarget (cognitive 17) internal/cli/foreign.go:374 — cli.resolveForeignTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runGitHubSet (cognitive 17) · ×1
  • cli.runGitHubSet (cognitive 17) internal/cli/github.go:1183 — cli.runGitHubSet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMintSetupRemoveRole (cognitive 17) · ×1
  • cli.runMintSetupRemoveRole (cognitive 17) internal/cli/mint_setup.go:429 — cli.runMintSetupRemoveRole has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.buildPersonaManifest (cognitive 17) · ×1
  • cli.buildPersonaManifest (cognitive 17) internal/cli/persona_manifest.go:70 — cli.buildPersonaManifest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.personaPassThrough (cognitive 17) · ×1
  • cli.personaPassThrough (cognitive 17) internal/cli/persona_manifest.go:133 — cli.personaPassThrough has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (2 pts) (nesting depth added 5). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.resolvePostReviewClient (cognitive 17) · ×1
  • cli.resolvePostReviewClient (cognitive 17) REDACTED:833 — cli.resolvePostReviewClient has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.detectRepoVisibility (cognitive 17) · ×1
  • cli.detectRepoVisibility (cognitive 17) internal/cli/prepareartifacts.go:381 — cli.detectRepoVisibility has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newGitLabRoleTokenClient (cognitive 17) · ×1
  • cli.newGitLabRoleTokenClient (cognitive 17) internal/cli/repos_gitlab_service_accounts.go:38 — cli.newGitLabRoleTokenClient has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 142, 42, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.resolveWorkItemID (cognitive 17) · ×1
  • cli.resolveWorkItemID (cognitive 17) internal/cli/run.go:5090 — cli.resolveWorkItemID has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.scanRepoContextFiles (cognitive 17) · ×1
  • cli.scanRepoContextFiles (cognitive 17) internal/cli/run.go:6657 — cli.scanRepoContextFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 6668). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.resolveAgentSource (cognitive 17) · ×1
  • cli.resolveAgentSource (cognitive 17) internal/cli/run.go:7901 — cli.resolveAgentSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.forgePointerAttrs (cognitive 17) · ×1
  • cli.forgePointerAttrs (cognitive 17) internal/cli/run_forge_attrs.go:33 — cli.forgePointerAttrs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.resolveJiraMintCloudID (cognitive 17) · ×1
  • cli.resolveJiraMintCloudID (cognitive 17) internal/cli/run_jira.go:335 — cli.resolveJiraMintCloudID has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolSpanTracker.Handle (cognitive 17) · ×1
  • toolSpanTracker.Handle (cognitive 17) internal/cli/tool_spans.go:108 — toolSpanTracker.Handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.clonePerRepo (cognitive 17) · ×1
  • config.clonePerRepo (cognitive 17) internal/config/managed.go:386 — config.clonePerRepo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LiveGCFClient.trySetCloudRunInvoker (cognitive 17) · ×1
  • LiveGCFClient.trySetCloudRunInvoker (cognitive 17) internal/dispatch/gcf/gcp.go:1105 — LiveGCFClient.trySetCloudRunInvoker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Provisioner.Provision (cognitive 17) · ×1
  • Provisioner.Provision (cognitive 17) internal/dispatch/gcf/provisioner.go:715 — Provisioner.Provision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalmeasure.decodeAny (cognitive 17) · ×1
  • evalmeasure.decodeAny (cognitive 17) internal/evalmeasure/parse.go:170 — evalmeasure.decodeAny has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.MergeChangeProposal (cognitive 17) · ×1
  • LiveClient.MergeChangeProposal (cognitive 17) REDACTED:4758 — LiveClient.MergeChangeProposal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListRepoVariables (cognitive 17) · ×1
  • LiveClient.ListRepoVariables (cognitive 17) internal/forge/gitlab/ci.go:417 — LiveClient.ListRepoVariables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListPipelineSchedules (cognitive 17) · ×1
  • LiveClient.ListPipelineSchedules (cognitive 17) internal/forge/gitlab/ci.go:1383 — LiveClient.ListPipelineSchedules has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.postInlineComments (cognitive 17) · ×1
  • LiveClient.postInlineComments (cognitive 17) internal/forge/gitlab/mr.go:645 — LiveClient.postInlineComments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListProjectMembers (cognitive 17) · ×1
  • LiveClient.ListProjectMembers (cognitive 17) internal/forge/gitlab/service_accounts.go:203 — LiveClient.ListProjectMembers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.GetProjectRoleActors (cognitive 17) · ×1
  • LiveClient.GetProjectRoleActors (cognitive 17) internal/forge/jira/client.go:960 — LiveClient.GetProjectRoleActors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitlabroles.DiagnoseLifecycle (cognitive 17) · ×1
  • gitlabroles.DiagnoseLifecycle (cognitive 17) internal/gitlabroles/lifecycle.go:69 — gitlabroles.DiagnoseLifecycle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness.LoadProviderDefs (cognitive 17) · ×1
  • harness.LoadProviderDefs (cognitive 17) REDACTED:134 — harness.LoadProviderDefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · Harness.validateSecurity (cognitive 17) · ×1
  • Harness.validateSecurity (cognitive 17) REDACTED:644 — Harness.validateSecurity has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.resolveSkillSourcesWithin (cognitive 17) · ×1
  • Harness.resolveSkillSourcesWithin (cognitive 17) REDACTED:735 — Harness.resolveSkillSourcesWithin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 1 (nesting depth added 5). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Harness.ValidateRunnerEnvSites (cognitive 17) · ×1
  • Harness.ValidateRunnerEnvSites (cognitive 17) REDACTED:885 — Harness.ValidateRunnerEnvSites has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.dispatch (cognitive 17) · ×1
  • Poller.dispatch (cognitive 17) internal/poll/dispatch.go:56 — Poller.dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · preset.fetchHTTPSWithTLSConfig (cognitive 17) · ×1
  • preset.fetchHTTPSWithTLSConfig (cognitive 17) internal/preset/preset.go:181 — preset.fetchHTTPSWithTLSConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.suppliedCredentialTokens (cognitive 17) · ×1
  • repos.suppliedCredentialTokens (cognitive 17) internal/repos/gitlab_roles_rotate.go:1866 — repos.suppliedCredentialTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.applyAdministratorEnrollmentProof (cognitive 17) · ×1
  • repos.applyAdministratorEnrollmentProof (cognitive 17) internal/repos/gitlab_roles_rotate.go:2221 — repos.applyAdministratorEnrollmentProof has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.revokePollerOwnedManagedTriggers (cognitive 17) · ×1
  • repos.revokePollerOwnedManagedTriggers (cognitive 17) internal/repos/gitlab_webhook_poller.go:774 — repos.revokePollerOwnedManagedTriggers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ExpectedScaffoldContent (cognitive 17) · ×1
  • repos.ExpectedScaffoldContent (cognitive 17) internal/repos/install.go:521 — repos.ExpectedScaffoldContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLabTriggerAccountOp.revokeOwnedTriggers (cognitive 17) · ×1
  • gitLabTriggerAccountOp.revokeOwnedTriggers (cognitive 17) internal/repos/gitlab_trigger_account.go:1636 — gitLabTriggerAccountOp.revokeOwnedTriggers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.parseClaudeToolSpecs (cognitive 17) · ×1
  • runtime.parseClaudeToolSpecs (cognitive 17) internal/runtime/pi_agent.go:157 — runtime.parseClaudeToolSpecs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.sanitizeError (cognitive 17) · ×1
  • telemetry.sanitizeError (cognitive 17) internal/telemetry/telemetry.go:71 — telemetry.sanitizeError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tracecontext.Admit (cognitive 17) · ×1
  • tracecontext.Admit (cognitive 17) internal/telemetry/tracecontext/envelope.go:478 — tracecontext.Admit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repoEnsurer.installFullsend (cognitive 17) · ×1
  • repoEnsurer.installFullsend (cognitive 17) pkg/behaviourtest/drivers/install/ensure.go:674 — repoEnsurer.installFullsend has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · traceCollector.Start (cognitive 17) · ×1
  • traceCollector.Start (cognitive 17) REDACTED:351 — traceCollector.Start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · behaviourtest.writeCompletionReport (cognitive 17) · ×1
  • behaviourtest.writeCompletionReport (cognitive 17) pkg/behaviourtest/report.go:180 — behaviourtest.writeCompletionReport has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.whenMintProbeRequests (cognitive 17) · ×1
  • steps.whenMintProbeRequests (cognitive 17) pkg/behaviourtest/steps/mint_probe.go:369 — steps.whenMintProbeRequests has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16 (17 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mintcore.RolePermissionsForLevel (cognitive 17) · ×1
  • mintcore.RolePermissionsForLevel (cognitive 17) internal/mintcore/github.go:345 — mintcore.RolePermissionsForLevel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JWKSVerifier.Verify (cognitive 17) · ×1
  • JWKSVerifier.Verify (cognitive 17) internal/mintcore/jwks_verifier.go:90 — JWKSVerifier.Verify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · analyze-transcript.detect_file_type (cognitive 17) · ×1
  • analyze-transcript.detect_file_type (cognitive 17) skills/analyze-transcript/analyze-transcript.py:215 — analyze-transcript.detect_file_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze-transcript.cmd_tools (cognitive 17) · ×1
  • analyze-transcript.cmd_tools (cognitive 17) skills/analyze-transcript/analyze-transcript.py:466 — analyze-transcript.cmd_tools has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Options.Validate (cognitive 16) · ×1
  • Options.Validate (cognitive 16) internal/agentnew/options.go:50 — Options.Validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.runAgentAdd (cognitive 16) · ×1
  • cli.runAgentAdd (cognitive 16) internal/cli/agent.go:390 — cli.runAgentAdd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.checkGitLabCredentialBinding (cognitive 16) · ×1
  • cli.checkGitLabCredentialBinding (cognitive 16) internal/cli/gitlab_profile.go:529 — cli.checkGitLabCredentialBinding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.durableCredentialWriteWarnings (cognitive 16) · ×1
  • cli.durableCredentialWriteWarnings (cognitive 16) internal/cli/provider_profile_report.go:259 — cli.durableCredentialWriteWarnings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.reconcileFailedGitLabWebhookSafety (cognitive 16) · ×1
  • cli.reconcileFailedGitLabWebhookSafety (cognitive 16) internal/cli/repos.go:1447 — cli.reconcileFailedGitLabWebhookSafety has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 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.
D2 · Cognitive Complexity · cli.planGatewayRoute (cognitive 16) · ×1
  • cli.planGatewayRoute (cognitive 16) internal/cli/run_gateway_route.go:92 — cli.planGatewayRoute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.prepareVendorFiles (cognitive 16) · ×1
  • cli.prepareVendorFiles (cognitive 16) internal/cli/vendor.go:76 — cli.prepareVendorFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 1 (nesting depth added 2). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · config.artifactsRelaxations (cognitive 16) · ×1
  • config.artifactsRelaxations (cognitive 16) internal/config/artifacts.go:226 — config.artifactsRelaxations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.waitForReady (cognitive 16) · ×1
  • Provisioner.waitForReady (cognitive 16) internal/dispatch/gcf/provisioner.go:1464 — Provisioner.waitForReady has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Provisioner.provisionRepoWIFProvider (cognitive 16) · ×1
  • Provisioner.provisionRepoWIFProvider (cognitive 16) internal/dispatch/gcf/provisioner.go:1527 — Provisioner.provisionRepoWIFProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · e2etest.tryCreateLock (cognitive 16) · ×1
  • e2etest.tryCreateLock (cognitive 16) internal/e2etest/lock.go:125 — e2etest.tryCreateLock 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveClient.ListServiceAccountPATs (cognitive 16) · ×1
  • LiveClient.ListServiceAccountPATs (cognitive 16) internal/forge/gitlab/service_accounts.go:121 — LiveClient.ListServiceAccountPATs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 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.
D2 · Cognitive Complexity · TriggerOwner.PollerUserID (cognitive 16) · ×1
  • TriggerOwner.PollerUserID (cognitive 16) internal/gitlablifecycle/trigger_owner.go:71 — TriggerOwner.PollerUserID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TriggerOwner.SuppliedPollerUserID (cognitive 16) · ×1
  • TriggerOwner.SuppliedPollerUserID (cognitive 16) internal/gitlablifecycle/trigger_owner.go:229 — TriggerOwner.SuppliedPollerUserID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 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.
D2 · Cognitive Complexity · harness.DiscoverRemoteAgents (cognitive 16) · ×1
  • harness.DiscoverRemoteAgents (cognitive 16) internal/harness/discover_remote.go:24 — harness.DiscoverRemoteAgents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller.webhookMergeRequestEvent (cognitive 16) · ×1
  • Poller.webhookMergeRequestEvent (cognitive 16) internal/poll/webhook.go:341 — Poller.webhookMergeRequestEvent 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.
D2 · Cognitive Complexity · repos.convergeVariables (cognitive 16) · ×1
  • repos.convergeVariables (cognitive 16) internal/repos/converge.go:2301 — repos.convergeVariables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.convergeSecrets (cognitive 16) · ×1
  • repos.convergeSecrets (cognitive 16) internal/repos/converge.go:2377 — repos.convergeSecrets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.checkGitLabJiraOAuthSupport (cognitive 16) · ×1
  • repos.checkGitLabJiraOAuthSupport (cognitive 16) internal/repos/gitlab_jira_poll.go:20 — repos.checkGitLabJiraOAuthSupport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.ManagedGitLabRoleAccountNames (cognitive 16) · ×1
  • repos.ManagedGitLabRoleAccountNames (cognitive 16) internal/repos/gitlab_managed_account_names.go:16 — repos.ManagedGitLabRoleAccountNames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.secretLeak (cognitive 16) · ×1
  • repos.secretLeak (cognitive 16) internal/repos/gitlab_roles.go:864 — repos.secretLeak has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.secretLeakRotate (cognitive 16) · ×1
  • repos.secretLeakRotate (cognitive 16) internal/repos/gitlab_roles_rotate.go:2125 — repos.secretLeakRotate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabJobAdmits (cognitive 16) · ×1
  • repos.gitlabJobAdmits (cognitive 16) internal/repos/gitlab_trigger_consumer.go:305 — repos.gitlabJobAdmits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabRetiredPublishedSafetyProblems (cognitive 16) · ×1
  • repos.gitlabRetiredPublishedSafetyProblems (cognitive 16) internal/repos/gitlab_trigger_dispatch_gate.go:210 — repos.gitlabRetiredPublishedSafetyProblems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.gitlabWrapperDispatcherProblem (cognitive 16) · ×1
  • repos.gitlabWrapperDispatcherProblem (cognitive 16) internal/repos/gitlab_webhook.go:1373 — repos.gitlabWrapperDispatcherProblem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.validateJiraPollInputs (cognitive 16) · ×1
  • repos.validateJiraPollInputs (cognitive 16) internal/repos/jira_poll.go:205 — repos.validateJiraPollInputs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · repos.lookupManifestEntry (cognitive 16) · ×1
  • repos.lookupManifestEntry (cognitive 16) REDACTED:1583 — repos.lookupManifestEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.probeResidualOpenAIWIF (cognitive 16) · ×1
  • repos.probeResidualOpenAIWIF (cognitive 16) internal/repos/openai_wif.go:354 — repos.probeResidualOpenAIWIF has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repos.openAIWIFCallerServes (cognitive 16) · ×1
  • repos.openAIWIFCallerServes (cognitive 16) internal/repos/openai_wif.go:776 — repos.openAIWIFCallerServes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest.validateConfigSource (cognitive 16) · ×1
  • Manifest.validateConfigSource (cognitive 16) REDACTED:1983 — Manifest.validateConfigSource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · runtime.trustedRulesFor (cognitive 16) · ×1
  • runtime.trustedRulesFor (cognitive 16) internal/runtime/opencode_bootstrap.go:302 — runtime.trustedRulesFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.mergeAgentProgress (cognitive 16) · ×1
  • runtime.mergeAgentProgress (cognitive 16) internal/runtime/task_progress_reconciler.go:256 — runtime.mergeAgentProgress has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Notifier.analyzeTimeline (cognitive 16) · ×1
  • Notifier.analyzeTimeline (cognitive 16) internal/statuscomment/statuscomment.go:457 — Notifier.analyzeTimeline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.validateHeaders (cognitive 16) · ×1
  • telemetry.validateHeaders (cognitive 16) internal/telemetry/telemetry.go:273 — telemetry.validateHeaders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.downloadArtifactAfter (cognitive 16) · ×1
  • Driver.downloadArtifactAfter (cognitive 16) pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:343 — Driver.downloadArtifactAfter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · composedDriver.provision (cognitive 16) · ×1
  • composedDriver.provision (cognitive 16) REDACTED:505 — composedDriver.provision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repoEnsurer.awaitDeletion (cognitive 16) · ×1
  • repoEnsurer.awaitDeletion (cognitive 16) pkg/behaviourtest/drivers/install/ensure.go:572 — repoEnsurer.awaitDeletion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · steps.classifyBotRoleResult (cognitive 16) · ×1
  • steps.classifyBotRoleResult (cognitive 16) pkg/behaviourtest/steps/bot_role_probe.go:434 — steps.classifyBotRoleResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 2 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ssrf_pretool._has_substitution (cognitive 16) · ×1
  • ssrf_pretool._has_substitution (cognitive 16) internal/security/hooks/ssrf_pretool.py:642 — ssrf_pretool._has_substitution has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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.
D2 · Cognitive Complexity · analyze-transcript._parse_source (cognitive 16) · ×1
  • analyze-transcript._parse_source (cognitive 16) skills/analyze-transcript/analyze-transcript.py:32 — analyze-transcript._parse_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · nextwork.is_completed_triage_stale (cognitive 16) · ×1
  • nextwork.is_completed_triage_stale (cognitive 16) skills/nextwork/scripts/nextwork.py:590 — nextwork.is_completed_triage_stale has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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.
D2 · Cognitive Complexity · nextwork.take_over (cognitive 16) · ×1
  • nextwork.take_over (cognitive 16) skills/nextwork/scripts/nextwork.py:2103 — nextwork.take_over has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 33 shared lines) · ×1
  • Near-duplicate member family (3 members, 33 shared lines) internal/cli/inference.go:67 — internal/cli/inference.go:67-177 | internal/cli/inference.go:328-387 | internal/cli/inference.go:585-649 — These 3 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 5 shared lines) · ×1
  • Near-duplicate member family (3 members, 5 shared lines) internal/harness/compose.go:2094 — internal/harness/compose.go:2094-2179 | internal/harness/compose.go:2272-2341 | internal/harness/compose.go:2481-2550 — These 3 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member pair (49 shared lines) · ×1
  • Near-duplicate member pair (49 shared lines) internal/e2etest/testutil.go:128 — internal/e2etest/testutil.go:128-286 | internal/e2etest/testutil.go:294-393 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) internal/cli/foreign.go:35 — internal/cli/foreign.go:35-119 | internal/cli/foreign.go:266-357 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (31 shared lines) · ×1
  • Near-duplicate member pair (31 shared lines) internal/harness/forge.go:69 — internal/harness/forge.go:69-135 | internal/harness/forge.go:156-210 — These two members are variants of one another: 31 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 (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) internal/cli/mint.go:755 — internal/cli/mint.go:755-908 | internal/cli/mint.go:1289-1344 | internal/cli/mint.go:1450-1506 | internal/cli/mint.go:2109-2189 | internal/cli/mint.go:2191-2271 | internal/cli/mint.go:2273-2344 | internal/cli/mint_delete.go:118-247 | internal/cli/mint_setup.go:42-130 | internal/cli/mint_setup.go:132-183 — These 9 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 9 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 9 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1248 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1248-1273 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1387-1409 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1632-1655 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1905-1937 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:437-462 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:528-550 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:652-675 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Edited copy of a member (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) pkg/behaviourtest/steps/base_dispatch.go:73 — pkg/behaviourtest/steps/base_dispatch.go:73-177 | pkg/behaviourtest/steps/url_dispatch.go:265-408 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) pkg/behaviourtest/steps/dispatch.go:23 — pkg/behaviourtest/steps/dispatch.go:23-72 | pkg/behaviourtest/steps/jirapoll.go:110-156 | pkg/behaviourtest/steps/runtime.go:32-75 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) pkg/behaviourtest/steps/bot_role_probe.go:241 — pkg/behaviourtest/steps/bot_role_probe.go:241-315 | pkg/behaviourtest/steps/mint_probe.go:369-450 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) internal/harness/compose.go:2184 — internal/harness/compose.go:2184-2259 | internal/harness/compose.go:2387-2476 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 72+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 72+ corresponding lines) internal/harness/compose.go:1455 — internal/harness/compose.go:1455-1526 | internal/harness/compose.go:1533-1619 | internal/harness/compose.go:1626-1716 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 72 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) internal/cli/run_jira.go:678 — internal/cli/run_jira.go:678-745 | internal/cli/run_openai.go:1151-1251 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:121 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:121-176 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:147-219 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) internal/harness/compose.go:2842 — internal/harness/compose.go:2842-2914 | internal/harness/forge.go:377-438 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) internal/dispatch/gcf/gcp.go:658 — internal/dispatch/gcf/gcp.go:658-708 | internal/dispatch/gcf/gcp.go:713-764 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) internal/mintclient/mintclient.go:191 — internal/mintclient/mintclient.go:191-256 | internal/mintclient/mintclient.go:265-339 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 60+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 60+ corresponding lines) internal/cli/issues.go:557 — internal/cli/issues.go:557-639 | internal/cli/issues.go:653-716 | internal/sticky/sticky.go:55-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 60 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) internal/forge/url.go:36 — internal/forge/url.go:36-109 | internal/forge/url.go:218-277 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) internal/harness/discover.go:28 — internal/harness/discover.go:28-81 | internal/harness/discover_remote.go:24-76 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) REDACTED:3783 — REDACTED:3783-3832 | internal/forge/gitlab/issue.go:95-143 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) internal/dispatch/gcf/gcp.go:1337 — internal/dispatch/gcf/gcp.go:1337-1389 | internal/dispatch/gcf/gcp.go:1393-1444 | internal/dispatch/gcf/gcp.go:1448-1487 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) REDACTED:1173 — REDACTED:1173-1220 | REDACTED:157-206 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) internal/mintcore/github.go:681 — internal/mintcore/github.go:681-717 | internal/mintcore/github.go:727-756 | internal/mintcore/github.go:759-788 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) pkg/behaviourtest/steps/base_dispatch.go:37 — pkg/behaviourtest/steps/base_dispatch.go:37-66 | pkg/behaviourtest/steps/base_dispatch.go:182-216 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) internal/celtrigger/celtrigger.go:47 — internal/celtrigger/celtrigger.go:47-78 | internal/harness/trigger.go:45-84 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) internal/mintcore/handler.go:733 — internal/mintcore/handler.go:733-765 | internal/mintcore/handler.go:837-869 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 32+ corresponding lines) internal/forge/gitlab/service_accounts.go:121 — internal/forge/gitlab/service_accounts.go:121-154 | internal/forge/gitlab/service_accounts.go:203-234 | internal/forge/gitlab/service_accounts.go:327-363 | internal/forge/gitlab/service_accounts.go:379-414 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) internal/forge/gitlab/ci.go:1817 — internal/forge/gitlab/ci.go:1817-1845 | internal/forge/gitlab/ci.go:1853-1888 | internal/forge/gitlab/deploy_keys.go:124-154 | internal/forge/gitlab/deploy_keys.go:199-237 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 24+ corresponding lines) internal/forge/gitlab/ci.go:1698 — internal/forge/gitlab/ci.go:1698-1721 | internal/forge/gitlab/ci.go:1725-1750 | internal/forge/gitlab/ci.go:1759-1789 | internal/forge/gitlab/hooks.go:228-251 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) internal/forge/gitlab/issue.go:197 — internal/forge/gitlab/issue.go:197-239 | internal/forge/gitlab/issue.go:242-272 | internal/forge/gitlab/issue.go:277-304 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 31+ corresponding lines) REDACTED:3835 — REDACTED:3835-3873 | REDACTED:3891-3929 | REDACTED:4109-4139 | REDACTED:4483-4521 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) internal/repos/gitlab_trigger_consumer.go:171 — internal/repos/gitlab_trigger_consumer.go:171-192 | internal/repos/gitlab_trigger_dispatch_gate.go:771-789 | internal/repos/gitlab_trigger_jobs.go:517-544 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 27+ corresponding lines) internal/forge/gitlab/poll.go:62 — internal/forge/gitlab/poll.go:62-88 | internal/forge/gitlab/poll.go:92-118 | internal/forge/gitlab/poll.go:124-162 | internal/forge/gitlab/poll.go:166-192 | internal/forge/gitlab/poll.go:196-222 | internal/forge/gitlab/poll.go:227-253 | internal/forge/gitlab/poll.go:257-283 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:159 — pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:159-191 | pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go:157-185 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) internal/dispatch/gcf/gcp.go:291 — internal/dispatch/gcf/gcp.go:291-309 | internal/dispatch/gcf/gcp.go:343-365 | internal/dispatch/gcf/gcp.go:767-785 | internal/dispatch/gcf/gcp.go:843-862 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 20+ corresponding lines) pkg/behaviourtest/steps/dispatch.go:78 — pkg/behaviourtest/steps/dispatch.go:78-101 | pkg/behaviourtest/steps/dispatch.go:106-128 | pkg/behaviourtest/steps/dispatch.go:172-197 | pkg/behaviourtest/steps/owners.go:267-287 | pkg/behaviourtest/steps/reaction.go:62-81 | pkg/behaviourtest/steps/url_dispatch.go:147-169 | pkg/behaviourtest/steps/url_dispatch.go:174-196 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:20 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:20-87 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:18-67 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) internal/forge/gitlab/ci.go:1956 — internal/forge/gitlab/ci.go:1956-1973 | internal/forge/gitlab/hooks.go:39-52 | internal/forge/gitlab/service_accounts.go:98-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) internal/runtime/claude_transcript.go:40 — internal/runtime/claude_transcript.go:40-59 | internal/runtime/codex_transcript.go:281-296 | internal/runtime/opencode_transcript.go:75-90 | internal/runtime/pi_transcript.go:159-174 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) REDACTED:3308 — REDACTED:3308-3322 | REDACTED:3375-3389 | REDACTED:5452-5472 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) REDACTED:3424 — REDACTED:3424-3435 | REDACTED:3479-3490 | REDACTED:5476-5487 | REDACTED:5621-5632 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) internal/forge/gitlab/ci.go:232 — internal/forge/gitlab/ci.go:232-248 | internal/forge/gitlab/ci.go:292-304 | internal/forge/gitlab/ci.go:355-371 | internal/forge/gitlab/ci.go:520-532 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) REDACTED:1791 — REDACTED:1791-1804 | REDACTED:2021-2036 | REDACTED:2048-2061 | REDACTED:2063-2078 | REDACTED:2089-2102 | REDACTED:2181-2194 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) pkg/behaviourtest/steps/actors.go:106 — pkg/behaviourtest/steps/actors.go:106-119 | pkg/behaviourtest/steps/actors.go:126-139 | pkg/behaviourtest/steps/actors.go:162-174 | pkg/behaviourtest/steps/actors.go:177-187 | pkg/behaviourtest/steps/actors.go:222-235 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) skills/adr-corner/scripts/adr_corner.py:468 — skills/adr-corner/scripts/adr_corner.py:468-478 | skills/adr-corner/scripts/adr_corner.py:499-509 | skills/topissues/scripts/topissues.py:353-367 | skills/topissues/scripts/topissues.py:378-395 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) internal/gitlablifecycle/trigger_account.go:143 — internal/gitlablifecycle/trigger_account.go:143-155 | internal/gitlablifecycle/trigger_account.go:159-171 | internal/gitlablifecycle/trigger_owner.go:797-809 | internal/gitlablifecycle/trigger_owner.go:813-825 | internal/gitlablifecycle/trigger_owner.go:915-927 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:286 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:286-305 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:307-323 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:873-889 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:901-917 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) internal/tracker/forge_client.go:126 — internal/tracker/forge_client.go:126-136 | internal/tracker/forge_client.go:140-150 | internal/tracker/forge_client.go:188-198 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) internal/mintcore/config.go:10 — internal/mintcore/config.go:10-21 | internal/mintcore/foreign.go:19-30 | pkg/behaviourtest/drivers/env/env.go:48-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 7+ corresponding lines) REDACTED:86 — REDACTED:86-92 | internal/repos/gitlab_roles.go:206-212 | internal/repos/gitlab_webhook.go:1852-1858 | pkg/behaviourtest/drivers/install/repopool_cfmint_previews.go:226-232 | pkg/behaviourtest/steps/mint_probe.go:483-489 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) internal/cli/run_gateway.go:104 — internal/cli/run_gateway.go:104-107 | internal/runtime/codex_gateway.go:150-153 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (49–53 lines × 2) · ×1
  • Duplicated block (49–53 lines × 2) internal/e2etest/testutil.go:141 — internal/e2etest/testutil.go:141-193 | internal/e2etest/testutil.go:222-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/e2etest/testutil.go:140` calls `logf` and `internal/e2etest/testutil.go:221` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–39 lines × 2) · ×1
  • Duplicated block (25–39 lines × 2) internal/cli/run_jira.go:680 — internal/cli/run_jira.go:680-704 | internal/cli/run_openai.go:1157-1195 — 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 `internal/cli/run_jira.go:680` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) internal/forge/jira/adf.go:867 — internal/forge/jira/adf.go:867-903 | internal/jirapoll/discover.go:439-476 — 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.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:587 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:587-655 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:920-988 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) internal/resolve/resolve.go:570 — internal/resolve/resolve.go:570-605 | internal/resolve/resolve.go:678-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) internal/repos/gitlab_roles.go:865 — internal/repos/gitlab_roles.go:865-897 | internal/repos/gitlab_roles_rotate.go:2126-2158 — 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. 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.
D4 · Code Duplication · Duplicated block (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) internal/runtime/codex_bootstrap.go:132 — internal/runtime/codex_bootstrap.go:132-162 | internal/runtime/pi_bootstrap.go:205-232 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) internal/cli/foreign.go:40 — internal/cli/foreign.go:40-68 | internal/cli/foreign.go:271-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/foreign.go:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/cli/foreign.go:300` calls `label` and `internal/cli/foreign.go:70` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) internal/dispatch/gcf/gcp.go:660 — internal/dispatch/gcf/gcp.go:660-686 | internal/dispatch/gcf/gcp.go:714-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) internal/e2etest/testutil.go:262 — internal/e2etest/testutil.go:262-286 | internal/e2etest/testutil.go:373-393 — both copies are in the same file, so extract the 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 `internal/e2etest/testutil.go:262` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/e2etest/testutil.go:261` calls `logf` and `internal/e2etest/testutil.go:372` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) internal/harness/compose.go:2205 — internal/harness/compose.go:2205-2229 | internal/harness/compose.go:2418-2440 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:2205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) pkg/behaviourtest/drivers/scm/github/github.go:132 — pkg/behaviourtest/drivers/scm/github/github.go:132-155 | pkg/behaviourtest/drivers/scm/gitlab/gitlab.go:123-146 — `pkg/behaviourtest/drivers/scm/github/github.go` and `pkg/behaviourtest/drivers/scm/gitlab/gitlab.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/scm/github/github.go:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) internal/fetch/fetch.go:337 — internal/fetch/fetch.go:337-357 | internal/gcp/client.go:232-254 — 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) internal/harness/compose.go:1103 — internal/harness/compose.go:1103-1123 | internal/harness/compose.go:1306-1324 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:1103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) internal/cli/poll.go:107 — internal/cli/poll.go:107-126 | internal/cli/poll.go:249-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) internal/cli/run.go:6869 — internal/cli/run.go:6869-6887 | internal/evalmeasure/find.go:140-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/evalmeasure/find.go:140` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) internal/runtime/claude.go:575 — internal/runtime/claude.go:575-591 | internal/runtime/pi_transcript.go:99-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 `internal/runtime/claude.go:575` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) internal/forge/gitlab/hooks.go:113 — internal/forge/gitlab/hooks.go:113-125 | internal/forge/gitlab/poll.go:359-374 — 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. 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) internal/harness/compose.go:2881 — internal/harness/compose.go:2881-2896 | internal/harness/forge.go:408-421 — 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 `internal/harness/compose.go:2881` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) internal/repos/gitlab_trigger_schedules.go:173 — internal/repos/gitlab_trigger_schedules.go:173-188 | internal/repos/gitlab_trigger_schedules.go:313-328 — both copies are in the same file, so extract the 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 `internal/repos/gitlab_trigger_schedules.go:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) internal/harness/compose.go:1112 — internal/harness/compose.go:1112-1126 | internal/harness/compose.go:1160-1173 | internal/harness/compose.go:1224-1237 | internal/harness/compose.go:1313-1327 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/harness/compose.go:1112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) internal/harness/compose.go:1339 — internal/harness/compose.go:1339-1353 | internal/harness/compose.go:1376-1390 | internal/harness/compose.go:1412-1426 — 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 `internal/harness/compose.go:1339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) internal/runtime/codex_bootstrap.go:132 — internal/runtime/codex_bootstrap.go:132-146 | internal/runtime/opencode_bootstrap.go:71-83 | internal/runtime/pi_bootstrap.go:205-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/runtime/codex_bootstrap.go:150` calls `validateAgentNameMatch`, `AgentName` and `internal/runtime/opencode_bootstrap.go:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1249 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1249-1262 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1633-1644 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:438-451 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:653-664 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) internal/harness/compose.go:968 — internal/harness/compose.go:968-979 | internal/harness/compose.go:2868-2881 | internal/harness/forge.go:396-408 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/harness/compose.go:968` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) pkg/behaviourtest/steps/base_dispatch.go:240 — pkg/behaviourtest/steps/base_dispatch.go:240-252 | pkg/behaviourtest/steps/dispatch.go:234-246 | pkg/behaviourtest/steps/dispatch.go:308-320 | pkg/behaviourtest/steps/url_dispatch.go:377-389 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) internal/harness/compose.go:288 — internal/harness/compose.go:288-299 | internal/harness/compose.go:421-433 — both copies are in the same file, so extract the 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 `internal/harness/compose.go:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–12 lines × 4) · ×1
  • Duplicated block (10–12 lines × 4) internal/repos/converge.go:3780 — internal/repos/converge.go:3780-3791 | internal/repos/converge.go:3828-3838 | internal/repos/converge.go:3862-3873 | internal/repos/converge.go:3894-3903 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/repos/converge.go:3862` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) internal/dispatch/gcf/provisioner.go:265 — internal/dispatch/gcf/provisioner.go:265-274 | internal/dispatch/gcf/provisioner.go:382-393 — both copies are in the same file, so extract the 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 `internal/dispatch/gcf/provisioner.go:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1252 — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1252-1264 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1391-1401 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1636-1646 | pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1910-1920 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:441-453 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:532-542 | pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go:656-666 — `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go` and `pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 254 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/drivers/ci/githubactions/githubactions.go:1252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) internal/cli/agent.go:301 — internal/cli/agent.go:301-310 | internal/cli/agent.go:436-446 | internal/cli/agent.go:549-559 | internal/cli/agent.go:794-804 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/agent.go:298` calls `UpsertAgentSettings`, `AgentEntry`, `localAgentEntries` and `internal/cli/agent.go:792` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) internal/cli/inference_gateway.go:112 — internal/cli/inference_gateway.go:112-121 | internal/cli/inference_openai.go:826-836 — 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 `internal/cli/inference_gateway.go:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) internal/cli/mint.go:1313 — internal/cli/mint.go:1313-1322 | internal/cli/mint.go:1473-1482 | internal/cli/mint.go:2124-2133 | internal/cli/mint.go:2206-2215 | internal/cli/mint.go:2287-2296 | internal/cli/mint_setup.go:75-84 | internal/cli/mint_setup.go:154-163 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/mint.go:1313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/cli/mint_setup.go:85` calls `ValidateAppSet`, `Errorf` and `internal/cli/mint_setup.go:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) internal/poll/events.go:293 — internal/poll/events.go:293-302 | internal/poll/events.go:356-365 | internal/poll/events.go:396-405 | internal/poll/events.go:435-444 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/poll/events.go:293` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) internal/e2etest/testutil.go:131 — internal/e2etest/testutil.go:131-140 | internal/e2etest/testutil.go:295-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/e2etest/testutil.go:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 10) · ×1
  • Duplicated block (8–9 lines × 10) pkg/behaviourtest/steps/dispatch.go:83 — pkg/behaviourtest/steps/dispatch.go:83-90 | pkg/behaviourtest/steps/dispatch.go:111-118 | pkg/behaviourtest/steps/dispatch.go:224-231 | pkg/behaviourtest/steps/dispatch.go:299-306 | pkg/behaviourtest/steps/owners.go:119-127 | pkg/behaviourtest/steps/owners.go:269-277 | pkg/behaviourtest/steps/reaction.go:31-38 | pkg/behaviourtest/steps/reaction.go:64-71 | pkg/behaviourtest/steps/url_dispatch.go:152-159 | pkg/behaviourtest/steps/url_dispatch.go:179-186 — there are 10 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 10 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) internal/harness/compose.go:1491 — internal/harness/compose.go:1491-1497 | internal/harness/compose.go:1513-1519 | internal/harness/compose.go:1583-1589 | internal/harness/compose.go:1606-1612 | internal/harness/compose.go:1680-1686 | internal/harness/compose.go:1703-1709 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) internal/repos/gitlab_trigger_consumer.go:247 — internal/repos/gitlab_trigger_consumer.go:247-250 | internal/repos/gitlab_trigger_jobs.go:520-525 | internal/repos/gitlab_webhook.go:697-702 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/repos/gitlab_trigger_jobs.go:520` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) cmd/mint/main.go:165 — cmd/mint/main.go:165-172 | internal/dispatch/gcf/provisioner.go:1894-1901 | internal/maputil/maputil.go:6-13 | internal/runtime/pi_gateway.go:356-363 | internal/sandbox/sandbox.go:1316-1323 | REDACTED:1225-1232 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Check import visibility before settling on that home: `internal/dispatch/gcf/provisioner.go`, `internal/maputil/maputil.go`, `internal/runtime/pi_gateway.go` sit under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) internal/cli/inference.go:79 — internal/cli/inference.go:79-115 | internal/cli/inference.go:337-353 | internal/cli/inference.go:594-616 — 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 `internal/cli/inference.go:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) internal/cli/run_jira.go:731 — internal/cli/run_jira.go:731-742 | internal/cli/run_openai.go:1232-1248 — 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 `internal/cli/run_jira.go:731` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–28 lines × 2) · ×1
  • Duplicated block (22–28 lines × 2) pkg/behaviourtest/steps/base_dispatch.go:99 — pkg/behaviourtest/steps/base_dispatch.go:99-120 | pkg/behaviourtest/steps/url_dispatch.go:295-322 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) internal/dispatch/gcf/gcp.go:296 — internal/dispatch/gcf/gcp.go:296-304 | internal/dispatch/gcf/gcp.go:348-356 | internal/dispatch/gcf/gcp.go:772-780 | internal/dispatch/gcf/gcp.go:848-856 | internal/dispatch/gcf/gcp.go:1179-1187 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/dispatch/gcf/gcp.go:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) internal/dispatch/gcf/gcp.go:297 — internal/dispatch/gcf/gcp.go:297-305 | internal/dispatch/gcf/gcp.go:349-357 | internal/dispatch/gcf/gcp.go:665-673 | internal/dispatch/gcf/gcp.go:696-704 | internal/dispatch/gcf/gcp.go:719-727 | internal/dispatch/gcf/gcp.go:752-760 | internal/dispatch/gcf/gcp.go:773-781 | internal/dispatch/gcf/gcp.go:801-809 | internal/dispatch/gcf/gcp.go:849-857 | internal/dispatch/gcf/gcp.go:1180-1188 — all 10 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 `internal/dispatch/gcf/gcp.go:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) REDACTED:3426 — REDACTED:3426-3433 | REDACTED:3481-3488 | REDACTED:5478-5485 | REDACTED:5623-5630 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (6 lines × 12) · ×1
  • Duplicated block (6 lines × 12) pkg/behaviourtest/steps/dispatch.go:83 — pkg/behaviourtest/steps/dispatch.go:83-88 | pkg/behaviourtest/steps/dispatch.go:111-116 | pkg/behaviourtest/steps/dispatch.go:224-229 | pkg/behaviourtest/steps/dispatch.go:299-304 | pkg/behaviourtest/steps/owners.go:119-125 | pkg/behaviourtest/steps/owners.go:269-275 | pkg/behaviourtest/steps/reaction.go:31-36 | pkg/behaviourtest/steps/reaction.go:64-69 | pkg/behaviourtest/steps/url_dispatch.go:99-104 | pkg/behaviourtest/steps/url_dispatch.go:128-133 | pkg/behaviourtest/steps/url_dispatch.go:152-157 | pkg/behaviourtest/steps/url_dispatch.go:179-184 — there are 12 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/behaviourtest/steps/dispatch.go:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/behaviourtest/steps/reaction.go:62` calls `DisableReactionNotifications` and `pkg/behaviourtest/steps/url_dispatch.go:97` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) internal/dispatch/gcf/gcp.go:510 — internal/dispatch/gcf/gcp.go:510-515 | internal/dispatch/gcf/gcp.go:606-611 | internal/dispatch/gcf/gcp.go:832-837 | internal/dispatch/gcf/gcp.go:1006-1011 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/dispatch/gcf/gcp.go:517` calls `waitForIAMOperation`, `Errorf` and `internal/dispatch/gcf/gcp.go:612` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) internal/dispatch/gcf/gcp.go:332 — internal/dispatch/gcf/gcp.go:332-336 | internal/dispatch/gcf/gcp.go:357-361 | internal/dispatch/gcf/gcp.go:422-426 | internal/dispatch/gcf/gcp.go:513-517 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/dispatch/gcf/gcp.go:332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) internal/security/hooks/ssrf_pretool.py:541 — internal/security/hooks/ssrf_pretool.py:541-565 | internal/security/hooks/ssrf_pretool.py:679-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) internal/security/hooks/ssrf_pretool.py:536 — internal/security/hooks/ssrf_pretool.py:536-555 | internal/security/hooks/ssrf_pretool.py:674-693 | internal/security/hooks/ssrf_pretool.py:824-843 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) internal/security/hooks/canary_posttool.py:52 — internal/security/hooks/canary_posttool.py:52-68 | internal/security/hooks/canary_pretool.py:43-59 | internal/security/hooks/context_suppress_posttool.py:108-125 | internal/security/hooks/tool_allowlist_pretool.py:36-52 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) internal/security/hooks/context_suppress_posttool.py:275 — internal/security/hooks/context_suppress_posttool.py:275-283 | internal/security/hooks/secret_redact_posttool.py:665-675 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) internal/sandbox/sandbox.go:1142 — internal/sandbox/sandbox.go:1142-1157 | internal/sandbox/sandbox.go:1177-1191 — both copies are in the same file, so extract the 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 `internal/sandbox/sandbox.go:1142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/sandbox/sandbox.go:1176` calls `Sprintf` and `internal/sandbox/sandbox.go:1141` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: github.com/fullsend-ai/fullsend/internal/mintcore — github.com/fullsend-ai/fullsend/internal/mintcore: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: LiveGCFClient (LCOM4 20) internal/dispatch/gcf/gcp.go:226 — LiveGCFClient's methods fall into 20 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 20 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.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×1
  • Process-global state is restored only on the happy path internal/cli/run.go:7764 — this function literal changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `v` environment variable (set at line 7767, cleared at line 7769) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic.
Minor — 89 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate internal/harness/discover.go:50 — `!strings.HasSuffix(name, ".yaml") && !strings.HasSuffix(name, ".yml")` appears character-identically in 2 files — internal/harness/discover.go, internal/harness/discover_remote.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 internal/fetch/cache.go:57 — `(c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')` appears character-identically in 2 files — internal/fetch/cache.go, internal/urlutil/urlutil.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 internal/dispatch/cf/provisioner.go:931 — `(c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')` appears character-identically in 2 files — internal/dispatch/cf/provisioner.go, internal/statuscomment/statuscomment.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 internal/evalmeasure/find.go:143 — `(r >= 'a' && r <= 'z') || (r >= '0' && r <= '9')` appears character-identically in 2 files — internal/evalmeasure/find.go, pkg/behaviourtest/steps/debuglogs.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 internal/dispatch/gcf/gitlab_wif.go:96 — `(r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '-'` appears character-identically in 2 files — internal/dispatch/gcf/gitlab_wif.go, internal/mintcore/wif.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/behaviourtest/drivers/ci/githubactions/githubactions.go:1555 — `aErr == nil && bErr == nil && !at.Equal(bt)` appears character-identically in 2 files — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go, pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.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 internal/repos/gitlab_poller_generation.go:870 — `bootErr == nil && (bootstrap == nil || bootstrap.Token == "")` appears character-identically in 2 files — internal/repos/gitlab_poller_generation.go, internal/repos/gitlab_webhook_poller.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 internal/gitlablifecycle/poller_handoff.go:140 — `bootstrap == nil || bootstrap.Token == ""` appears character-identically in 2 files — internal/gitlablifecycle/poller_handoff.go, internal/gitlablifecycle/trigger_owner.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 internal/config/config.go:1300 — `c.Inference != nil && c.Inference.Provider != ""` appears character-identically in 2 files — internal/config/config.go, internal/config/interfaces.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/behaviourtest/drivers/ci/githubactions/githubactions.go:140 — `candidate.Status == "completed" && candidate.Conclusion != "success"` appears character-identically in 2 files — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go, pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.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 internal/repos/converge.go:859 — `cfg.InferenceProject != "" && !IsValidGCPProjectID(cfg.InferenceProject)` appears character-identically in 2 files — internal/repos/converge.go, internal/repos/install.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 internal/repos/gitlab_jira_poll.go:238 — `detail == nil || detail.ID != s.ID || detail.Description != s.Description` appears character-identically in 2 files — internal/repos/gitlab_jira_poll.go, internal/repos/gitlab_trigger_schedules.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 internal/repos/gitlab_pipeline_var_restriction.go:290 — `detail == nil || detail.ID != schedule.ID || detail.Description != schedule.Description` appears character-identically in 2 files — internal/repos/gitlab_pipeline_var_restriction.go, internal/repos/gitlab_trigger_dispatch_gate.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 internal/config/managed_schema.go:98 — `doc.Kind != yaml.DocumentNode || len(doc.Content) != 1 || doc.Content[0].Kind != yaml.MappingNode` appears character-identically in 3 files — internal/config/managed_schema.go, REDACTED, internal/repos/manifest_legacy_tracking.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 internal/repos/gitlabci.go:232 — `doc.Kind != yaml.DocumentNode || len(doc.Content) == 0` appears character-identically in 2 files — internal/repos/gitlabci.go, internal/repos/manifest_set.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:149 — `e.IsDir() || (!strings.HasSuffix(e.Name(), ".yaml") && !strings.HasSuffix(e.Name(), ".yml"))` appears character-identically in 2 files — REDACTED, internal/resolve/resolve.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:398 — `e.StatusCode == http.StatusTooManyRequests || (e.StatusCode >= 500 && e.StatusCode <= 504)` appears character-identically in 3 files — REDACTED, internal/forge/gitlab/gitlab.go, internal/forge/jira/client.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 internal/runtime/claude_transcript.go:49 — `entry.IsDir() || !strings.HasSuffix(entry.Name(), ".jsonl")` appears character-identically in 4 files — internal/runtime/claude_transcript.go, internal/runtime/codex_transcript.go, internal/runtime/opencode_transcript.go, internal/runtime/pi_transcript.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/behaviourtest/drivers/scm/github/github.go:112 — `err != nil && forge.IsAlreadyExists(err)` appears character-identically in 2 files — pkg/behaviourtest/drivers/scm/github/github.go, pkg/behaviourtest/drivers/scm/gitlab/gitlab.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 internal/repos/gitlab_trigger_consumer.go:173 — `err != nil || len(docs) == 0 || docs[len(docs)-1].Kind != yaml.DocumentNode || len(docs[len(docs)-1].Content) == 0` appears character-identically in 5 files — internal/repos/gitlab_trigger_consumer.go, internal/repos/gitlab_trigger_dispatch_gate.go, internal/repos/gitlab_trigger_job_templates.go, internal/repos/gitlab_trigger_jobs.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 internal/repos/gitlab_trigger_consumer.go:128 — `err != nil || len(docs) == 0 || len(docs[len(docs)-1].Content) == 0` appears character-identically in 2 files — internal/repos/gitlab_trigger_consumer.go, internal/repos/gitlab_trigger_dispatch_gate.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 internal/repos/managed_config.go:481 — `err != nil || mu.Scheme != "https" || mu.Host == ""` appears character-identically in 2 files — internal/repos/managed_config.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 internal/cli/skill_staging.go:218 — `err != nil || rel == ".." || strings.HasPrefix(rel, ".."+string(filepath.Separator))` appears character-identically in 2 files — internal/cli/skill_staging.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/behaviourtest/drivers/ci/githubactions/githubactions.go:1294 — `err == nil && candidate.Status == "completed"` appears character-identically in 2 files — pkg/behaviourtest/drivers/ci/githubactions/githubactions.go, pkg/behaviourtest/drivers/ci/gitlabci/gitlabci.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 internal/harness/compose.go:1078 — `err == nil && rel != ".." && !strings.HasPrefix(rel, ".."+string(filepath.Separator))` appears character-identically in 2 files — internal/harness/compose.go, internal/resolve/resolve.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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on error · ×16
  • Silent fallback default on error internal/cli/agent.go:997 — `allowlistPrefixForURL` 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 internal/cli/tirith_repo_policy.go:70 — `prBaseSHAFromEventPath` 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 internal/cli/mint_tracing.go:44 — `endpointOrigin` 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 internal/dispatch/cf/provisioner.go:710 — `findRepoRoot` 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 internal/dispatch/gcf/provisioner.go:1194 — `deriveAllowedRoles` 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 internal/e2etest/auth.go:238 — `leadingInt` turns a non-nil `err` into `return 0, 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 internal/e2etest/buildargs.go:77 — `headCommit` 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 internal/harness/compose.go:2598 — `urlParentDirPrefix` 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 internal/pluginformat/pi.go:233 — `extensionManifest` turns a non-nil `err` into `return piPackageManifest{}, ""` — 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 internal/repos/gitlab_webhook.go:2546 — `triggerURLToken` 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 internal/runtime/claude_progress.go:641 — `toolResultText` turns a non-nil `err` into `return "", true` — 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 internal/runtime/claude_progress.go:726 — `extractRawContext` 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 internal/runtime/pi_progress.go:129 — `piToolContext` 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 internal/runtime/pi_progress.go:277 — `piResultText` turns a non-nil `err` into `return "", true` — 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 internal/sandbox/sandbox.go:346 — `inGitDir` turns a non-nil `err` into `return false, ""` — 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/behaviourtest/steps/jirapoll_transport.go:145 — `pipelineInputString` 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.
AX6 · Interface segregation · Fat interface · ×7
  • Fat interface: PerRepoConfigReader (22 methods) internal/config/interfaces.go:62 — `PerRepoConfigReader` declares 22 methods: `ConfigRoles`, `ConfigRuntime`, `ConfigForge`, `ConfigTracker`, `ConfigMintURL`, `ConfigMintURLFromFile`, `ConfigKeepHistory`, `ConfigInferenceProvider`, `ConfigInferenceProject`, `ConfigInferenceRegion`, `ConfigInferenceWIFProvider`, `ConfigInferenceWIFAudience`, `ConfigInferenceServiceAccount`, `ConfigInferenceOpenAI`, `ConfigInferenceGateway`, `ConfigModelAliases`, `ConfigArtifactsContent`, `ConfigArtifactsContentSet`, `ConfigArtifactsBySource`, `IsOwnersFileAuthEnabled`, `JiraAuthorization`, `TraceContext`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: PerRepoConfigWriter (16 methods) internal/config/interfaces.go:133 — `PerRepoConfigWriter` declares 16 methods: `SetRoles`, `SetRuntime`, `SetMintURL`, `SetKeepHistory`, `SetInferenceProvider`, `SetInferenceProject`, `SetInferenceRegion`, `SetInferenceWIFProvider`, `SetInferenceWIFAudience`, `SetInferenceServiceAccount`, `SetInferenceOpenAI`, `SetInferenceGateway`, `MergeInferenceGateway`, `SetModelAliases`, `SetOwnersFileAuthEnabled`, `SetIssueTracking`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: GCFClient (32 methods) internal/dispatch/gcf/gcp.go:146 — `GCFClient` declares 32 methods: `CreateServiceAccount`, `DeleteServiceAccount`, `CreateWIFPool`, `DeleteWIFPool`, `CreateWIFProvider`, `GetWIFProvider`, `UpdateWIFProvider`, `DisableWIFProvider`, `DeleteWIFProvider`, `GetSecret`, `CreateSecret`, `AddSecretVersion`, `AccessSecretVersion`, `DisableSecretVersion`, `EnableSecretVersion`, `DeleteSecret`, `SetSecretIAMBinding`, `ReplaceSecretIAMBinding`, `SetProjectIAMBinding`, `SetCloudRunInvoker`, `DeleteFunction`, `GetFunction`, `GetCloudRunServiceURI`, `UploadFunctionSource`, `CreateFunction`, `UpdateFunction`, `UpdateFunctionEnvVars`, `UpdateServiceEnvVars`, `GetServiceRevisionInfo`, `GetServiceTrafficEnvVars`, `WaitForOperation`, `GetProjectNumber`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Client (129 methods) REDACTED:1040 — `Client` declares 129 methods: `ListOrgRepos`, `GetRepo`, `CreateRepo`, `UpdateRepoVisibility`, `DeleteRepo`, `FindExistingFork`, `CreateFork`, `CreateForkInOrg`, `DeleteProjectServiceAccount`, `CreateFile`, `CreateOrUpdateFile`, `GetFileContent`, `UpdateFileIfMatch`, `DeleteFile`, `DeleteFiles`, `ListDirectoryContents`, `ListRepositoryFiles`, `GetFileContentAtRef`, `CommitFiles`, `CommitFilesToBranch`, `ForceCommitFileToBranch`, `GetRef`, `GetBranchRef`, `CreateBranch`, `CreateBranchFromSHA`, `DeleteBranch`, `DeleteRef`, `CreateFileOnBranch`, `CreateOrUpdateFileOnBranch`, `CreateChangeProposal`, `CreateCrossRepoChangeProposal`, `ListRepoPullRequests`, `CloseChangeProposal`, `GetOrgPlan`, `GetAuthenticatedUser`, `GetAuthenticatedUserIdentity`, `GetTokenScopes`, `IsInstallationToken`, `CreateRepoSecret`, `RepoSecretExists`, and 89 more. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: GitLabClient (22 methods) internal/poll/client.go:24 — `GitLabClient` declares 22 methods: `ListIssuesUpdatedSince`, `ListMergeRequestsUpdatedSince`, `ListProjectEvents`, `ListIssueNotes`, `ListMergeRequestNotes`, `ListMergeRequestDiffVersions`, `ListResourceLabelEvents`, `GetFileContentAtRef`, `GetBranchRef`, `CommitFileToBranch`, `ForceCommitFileToBranch`, `DeleteRef`, `GetAuthenticatedUser`, `GetAuthenticatedUserID`, `GetUserBot`, `CreateNoteAwardEmoji`, `GetIssue`, `GetMergeRequest`, `GetMemberAccessLevel`, `GetProjectPath`, `CreatePipelineWithInputs`, `CreateChildPipelineWithInputs`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: GitLabTriggerAccountAPI (22 methods) internal/repos/gitlab_trigger_account.go:97 — `GitLabTriggerAccountAPI` declares 22 methods: `GetAuthenticatedUserID`, `ListProjectServiceAccounts`, `CreateProjectServiceAccount`, `DeleteProjectServiceAccount`, `GetProjectMemberAccessLevel`, `AddProjectMember`, `UpdateProjectMemberAccessLevel`, `CreateServiceAccountPAT`, `ListServiceAccountPATs`, `RevokeServiceAccountPAT`, `HasExactProtectedBranchRule`, `GrantProtectedBranchPushDeployKey`, `ProtectedBranchPushDeployKeyEntryID`, `RevokeProtectedBranchPushDeployKeyEntry`, `ListProjectDeployKeys`, `DeleteProjectDeployKey`, `ListPipelineTriggerTokens`, `RevokePipelineTriggerToken`, `AccountSSHKeyIDs`, `AccountActiveJobIDs`, `AccountScheduleIDs`, `UnknownOwnerScheduleIDs`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Driver (29 methods) pkg/behaviourtest/drivers/scm/driver.go:21 — `Driver` declares 29 methods: `CreateIssue`, `AddIssueLabels`, `EnsureLabel`, `AddComment`, `GetIssue`, `ListOpenIssues`, `GetFileContent`, `GetFileContentAtRef`, `CommitFile`, `CreateBranch`, `DeleteBranch`, `CommitFileToBranch`, `CreateChangeProposal`, `SubmitPullRequestReview`, `CloseIssue`, `ListOpenChangeProposals`, `ListComments`, `ListIssueReactions`, `CreateRepo`, `EnsureRepoPublic`, `GetDefaultBranch`, `GetBranchRef`, `DeleteRepo`, `CreateFork`, `CreateUserFork`, `CommitFileToFork`, `CreateForkChangeProposal`, `ListPullRequestReviews`, `ListPullRequestCommits`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D20 · ADR Quality · ADR superseded but its status says otherwise · ×7
  • ADR superseded but its status says otherwise docs/ADRs/0061-harness-cel-dispatch.md:3 — docs/ADRs/0061-harness-cel-dispatch.md:3 says "Accepted", but docs/ADRs/0098-entity-first-harness-evaluation.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0063-polling-based-work-discovery.md:3 — docs/ADRs/0063-polling-based-work-discovery.md:3 says "Accepted", but docs/ADRs/0098-entity-first-harness-evaluation.md, docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0052-functional-tests-for-agent-pipelines.md:3 — docs/ADRs/0052-functional-tests-for-agent-pipelines.md:3 says "Accepted", but docs/ADRs/0139-agent-functional-test-suite-lives-in-agents-repo.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md:3 — docs/ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md:3 says "Accepted", but docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0098-entity-first-harness-evaluation.md:3 — docs/ADRs/0098-entity-first-harness-evaluation.md:3 says "Accepted", but docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md, docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md:3 — docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md:3 says "Accepted", but docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/ADRs/0021-jsonl-reasoning-trace-exposure.md:3 — docs/ADRs/0021-jsonl-reasoning-trace-exposure.md:3 says "Accepted", but docs/ADRs/0161-repo-config-limits-run-artifact-content.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 20 significant file(s) lose their only recent owner: pkg/behaviourtest/steps/runtime.go, internal/agentnew/generate.go, internal/runtime/pi_extensions.go, internal/security/hooks/hook_io.py, internal/security/hooks/context_suppress_posttool.py, internal/runtime/pi_transcript.go, internal/scaffold/fullsend-repo/scripts/resolve-precommit-tools.py, internal/security/hooks/tool_allowlist_pretool.py (+12 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: skills/user-forum-whats-new/scripts/gather.py, internal/evalmeasure/export_otlp.go, internal/evalmeasure/fitness.go, hack/prove-otlp-scores/main.go, internal/evalmeasure/parse.go, internal/evalmeasure/types.go, internal/evalmeasure/run.go. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure internal/security/hooks/posttool_chain.py:91 — `_command` returns `''` when `(json.JSONDecodeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure internal/security/hooks/secret_redact_posttool.py:224 — `content_skips` returns `frozenset()` when `(ValueError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 handler or in the docstring, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 4 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 (48 single-owned of 388 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 388 of the 573 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (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: internal/cli/content_collector.go, internal/runtime/codex_personas.go, internal/cli/mint_setup.go, internal/binary/acquire.go, internal/evalmeasure/runhealth.go, internal/layers/layers.go.
D21 · Naming Consistency · `appSlugRE` spells `RE` where 55 names in the project spell it `Re` · ×1
  • `appSlugRE` spells `RE` where 55 names in the project spell it `Re` internal/cli/mint_setup.go:211 — 55 of 57 names in project github.com/fullsend-ai/fullsend spell the token `Re` (55 of 57; unit: names in project github.com/fullsend-ai/fullsend containing `Re`). Peers: botidentity.canonicalRoleRe (internal/botidentity/mint.go:56); cli.pemPrivateKeyRe (internal/cli/host_file_credentials.go:35); cli.hexSHARe (REDACTED:38); cli.reasonRe (REDACTED:39); cli.hunkHeaderRe (REDACTED:40). Rename to `appSlugRe`. [rule N6]
D21 · Naming Consistency · `varExpressionRE` spells `RE` where 55 names in the project spell it `Re` · ×1
  • `varExpressionRE` spells `RE` where 55 names in the project spell it `Re` internal/repos/openai_wif.go:550 — 55 of 57 names in project github.com/fullsend-ai/fullsend spell the token `Re` (55 of 57; unit: names in project github.com/fullsend-ai/fullsend containing `Re`). Peers: botidentity.canonicalRoleRe (internal/botidentity/mint.go:56); cli.pemPrivateKeyRe (internal/cli/host_file_credentials.go:35); cli.hexSHARe (REDACTED:38); cli.reasonRe (REDACTED:39); cli.hunkHeaderRe (REDACTED:40). Rename to `varExpressionRe`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion package.json:1 — `(repository root)` (211831 LoC, 854 module-visible types across 105 directories) overshoots its size bounds. 1 of 5 build unit(s) (Go, npm) overshoot their size bounds, lowering Project Cohesion to 6.0/10. 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.
D27 · Navigability · Scattered collaborators · ×1
  • Scattered collaborators — 56 % of calls cross a namespace and only 51 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M1 · Documentation (README) · Thin README · ×1
  • Thin README README.md:1 — The root README is 84 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
M2 · Architecture documentation · Architecture diagram out of date · ×1
  • Architecture diagram out of date docs/guides/user/bring-your-own-agent.md:153 — `docs/guides/user/bring-your-own-agent.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `mint-wasm`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `cmd/mint-wasm`.
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 47/49 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex internal/runtime/pi_progress.go:95 — 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.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand docs/.vitepress/markdown-sources.ts:125 — `href.startsWith("//")` can never decide this `||` — every value satisfying `href.startsWith("//")` also satisfies `href.startsWith("/")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 23 finding(s)
D12 · Dependency Hygiene · Outdated · ×15
  • Outdated: github.com/cucumber/gherkin/go/v42 — `github.com/cucumber/gherkin/go/v42` is required at v42.0.0 in REDACTED, but v42.0.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/cucumber/gherkin/go/v42@v42.0.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/knights-analytics/hugot — `github.com/knights-analytics/hugot` is required at v0.7.7 in REDACTED, but v0.8.6 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/knights-analytics/hugot@v0.8.6 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/sigstore/sigstore-go — `github.com/sigstore/sigstore-go` is required at v1.3.0 in REDACTED, but v1.4.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/sigstore/sigstore-go@v1.4.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/spf13/pflag — `github.com/spf13/pflag` is required at v1.0.10 in REDACTED, but v1.1.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/spf13/pflag@v1.1.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel — `go.opentelemetry.io/otel` is required at v1.44.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp — `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` is required at v1.44.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/sdk — `go.opentelemetry.io/otel/sdk` is required at v1.44.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/sdk@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/trace — `go.opentelemetry.io/otel/trace` is required at v1.44.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/trace@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/proto/otlp — `go.opentelemetry.io/proto/otlp` is required at v1.10.0 in REDACTED, but v1.11.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/proto/otlp@v1.11.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.54.0 in REDACTED, but v0.59.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/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/oauth2 — `golang.org/x/oauth2` is required at v0.36.0 in REDACTED, but v0.38.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/oauth2@v0.38.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.22.0 in REDACTED, but v0.25.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/sync@v0.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.20.0 in internal/mintcore/REDACTED, but v0.25.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/sync@v0.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/term — `golang.org/x/term` is required at v0.45.0 in REDACTED, but v0.48.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/term@v0.48.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.44.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.44.0 && go mod tidy` and commit the updated REDACTED and go.sum.
D10 · Test Quality · Skipped (documented) · ×8
  • Skipped (documented): run: a timed-out child gets SIGTERM, so its detached grandchildren die with it internal/runtime/pi_extension/fullsend-agent.test.mjs:604 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): real pi: the prompt goes over stdin because argv cannot carry it internal/runtime/pi_extension/fullsend-agent.test.mjs:1646 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): real pi: ${label} fails without the extension and is applied with it internal/runtime/pi_extension/fullsend-edit-repair.test.mjs:252 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): real pi: tool allowlists and the extension's edit tool internal/runtime/pi_extension/fullsend-edit-repair.test.mjs:270 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): MCP resources: Claude hook groups and the real allowlist see translated names internal/runtime/pi_extension/fullsend-hooks.test.mjs:284 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): runScript with a real python3 script (skipped without python3) internal/runtime/pi_extension/fullsend-hooks.test.mjs:335 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): runScript: a python3 stub earlier on PATH is never used for hooks (skipped without python3) internal/runtime/pi_extension/fullsend-hooks.test.mjs:353 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): runScript: a hook's tools resolve on the trusted PATH, not the inherited one (skipped without python3) internal/runtime/pi_extension/fullsend-hooks.test.mjs:428 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-930fb83fdd3a4b9eafc7e690baa60a9e/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-930fb83fdd3a4b9eafc7e690baa60a9e/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-930fb83fdd3a4b9eafc7e690baa60a9e/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=6317" --report-format json --report-path /tmp/watchdog-gitleaks-930fb83fdd3a4b9eafc7e690baa60a9e/history-3.json --exit-code 0 --source .3artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-930fb83fdd3a4b9eafc7e690baa60a9e/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude .fullsend --exclude cloudflare_site/worker --exclude docs/.vitepress --exclude docs/ADRs --exclude docs/archived-roadmaps --exclude docs/cli --exclude docs/contributing --exclude docs/guides --exclude docs/normative --exclude docs/problems --exclude docs/reference --exclude docs/runtimes --exclude docs/spikes --exclude docs/testing --exclude docs/v --exclude internal/agentnew/templates/policies --exclude internal/botidentity/testdata --exclude internal/cli/testdata/lint-json --exclude internal/dispatch/cf/workersrc/src --exclude internal/runtime/pi_extension --exclude internal/scaffold/fullsend-repo/profiles --exclude internal/scaffold/fullsend-repo/providers --exclude internal/scaffold/fullsend-repo/templates --exclude internal/scaffold/fullsend-repo-gitlab/.fullsend --exclude internal/scaffold/testdata/walkembedfs/.fullsend --exclude web/public .29artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .27artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .5artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e4dc-03fa-7b9c-96e0-ed691a9499d6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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