Public report of MattFiler/OpenCAGE, 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 reportMeasured 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, 22:04 UTC · Survey ID cd_886d2bfcb5ad48f3a18cbb62a4a565ac
MattFiler/OpenCAGE
Measured 16 November 2026, 22:02 UTC, at code version b8c8ea9
Boundary Type-Coupling is not measured: Bounded contexts not declared.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
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: 285,772 lines of product code in 4 projects, tests not counted · Estimated rebuild effort: about 8.8 person-years · Weakest lens: Production Readiness, 17.5
Findings by how serious they are
362 critical2375 serious214 minor
3 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 22:02 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.
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 ▸
63of 63 dimensions measured by tools.
2943of 2951 findings point to an exact file and line, so you can open each one in the code. The other 8 concern the repository as a whole, such as missing documentation.
63dimensions across 6 lenses, read from 285,772 lines of product code in 4 projects.
MattFiler/OpenCAGE falls short of our standard for production because the project has no automated tests and we found no working pipeline that builds or tests changes to the code. It scores 35.4 out of 100 and is rated Weak, and none of its 362 critical findings concern security.
Production Readiness, at 17.5, is the weakest lens and counts most in the score. The best first step is adding automated tests, worth about 16.5 points. Raising Production Readiness to 70 would lift the score to about 51.2.
The project has no automated tests, so a change can break it without warning. 353 errors are caught and ignored, so failures can go unnoticed. Adding automated tests and handling or logging the ignored errors would close both risks. The seven data fields that are written but never read need removing.
The product code is 285,772 lines, about €1,300,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 17.5 to 70, the lowest score rated Strong, the score would rise from 35.4 to about 51.2.
Code composition: what the lines of code are
Business logic 61%Supporting code 23%Generated by tools 16%
Rebuild cost: about €1,300,000 · Estimate
Cost to rebuild
€410,000 to €2,100,000, for 6,867 to 22,567 hours of work, about 8.8 person-years for 5 to 17 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 35. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 285,772 lines of product code
Comment lines
The estimate prices 265,693 lines. Comment lines count towards the size of 285,772 lines but aren't priced as work.
What it is not
Not 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.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No automated tests finding(s) in Code Coverage.
Raises the score by about 16.5 points · High effort · Code Coverage
2
Resolve the 7 WriteOnlyPrivateField finding(s) in Explicit Debt — start with BlendSetUserPicker.cs, SelectShaderPermutation.cs, CompositeTree.cs.
Raises the score by about 2.7 points · Low effort · Explicit Debt
3
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Downloader.csproj.
Raises the score by about 2.5 points · Low effort · ADR Quality
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 €1,300,000 to build again, about 8.8 person-years of work. Its weakest lens is Production Readiness, at 17.5 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No automated tests finding(s) in Code Coverage. Of all the actions in this report, it raises the score most for the work it takes: about 16.5 points for high effort, because it clears the 1 Code Coverage findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 307,446 lines over the last 90 days, which is about 1,246,864 lines a year. At that pace, the extra work comes to an estimated 191 to 1146 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: 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.
29 modules, with 61 dependencies between them. One loop runs through 16 of the modules, marked above the diagonal.
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.
OpenCAGE.Modding.Merging uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.Modding.Merging, while a change to OpenCAGE.Modding.Merging can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→26 OpenCAGE.Popups.Base uses OpenCAGEpart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.Popups.Base uses a type in OpenCAGE.
OpenCAGE.Popups.Base uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.Popups.Base, while a change to OpenCAGE.Popups.Base can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→20 OpenCAGE.Popups.Configuration_Editors.User_Controls uses OpenCAGE.ConfigEditorspart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.Popups.Configuration_Editors.User_Controls uses a type in OpenCAGE.ConfigEditors.
OpenCAGE.Popups.Configuration_Editors.User_Controls uses OpenCAGE.ConfigEditors, so a change to OpenCAGE.ConfigEditors can break OpenCAGE.Popups.Configuration_Editors.User_Controls, while a change to OpenCAGE.Popups.Configuration_Editors.User_Controls can't break OpenCAGE.ConfigEditors.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→26 OpenCAGE.Popups.UserControls uses OpenCAGEpart of a loop✕
Connections
10 pairs of types, where a type in OpenCAGE.Popups.UserControls uses a type in OpenCAGE.
OpenCAGE.Popups.UserControls uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.Popups.UserControls, while a change to OpenCAGE.Popups.UserControls can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→24 OpenCAGE.RuntimeUtilsConnection uses OpenCAGE.DockPanelspart of a loop✕
Connections
2 pairs of types, where a type in OpenCAGE.RuntimeUtilsConnection uses a type in OpenCAGE.DockPanels.
OpenCAGE.RuntimeUtilsConnection uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.RuntimeUtilsConnection, while a change to OpenCAGE.RuntimeUtilsConnection can't break OpenCAGE.DockPanels.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→24 OpenCAGE.Scripts uses OpenCAGE.DockPanelspart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.Scripts uses a type in OpenCAGE.DockPanels.
OpenCAGE.Scripts uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.Scripts, while a change to OpenCAGE.Scripts can't break OpenCAGE.DockPanels.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→26 OpenCAGE.Scripts uses OpenCAGEpart of a loop✕
Connections
3 pairs of types, where a type in OpenCAGE.Scripts uses a type in OpenCAGE.
OpenCAGE.TextureTools uses DirectXTex, so a change to DirectXTex can break OpenCAGE.TextureTools, while a change to OpenCAGE.TextureTools can't break DirectXTex.
Position
Below the diagonal: OpenCAGE.TextureTools uses a module listed above it, which is the healthy direction.
OpenCAGE.UserControls uses (global), so a change to (global) can break OpenCAGE.UserControls, while a change to OpenCAGE.UserControls can't break (global).
Position
Below the diagonal: OpenCAGE.UserControls uses a module listed above it, which is the healthy direction.
OpenCAGE.UserControls uses OpenCAGE.Audio, so a change to OpenCAGE.Audio can break OpenCAGE.UserControls, while a change to OpenCAGE.UserControls can't break OpenCAGE.Audio.
Position
Below the diagonal: OpenCAGE.UserControls uses a module listed above it, which is the healthy direction.
19→24 OpenCAGE.UserControls uses OpenCAGE.DockPanelspart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.UserControls uses a type in OpenCAGE.DockPanels.
OpenCAGE.UserControls uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.UserControls, while a change to OpenCAGE.UserControls can't break OpenCAGE.DockPanels.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→26 OpenCAGE.UserControls uses OpenCAGEpart of a loop✕
Connections
2 pairs of types, where a type in OpenCAGE.UserControls uses a type in OpenCAGE.
OpenCAGE.UserControls uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.UserControls, while a change to OpenCAGE.UserControls can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
27 pairs of types, where a type in OpenCAGE.ConfigEditors uses a type in OpenCAGE.Popups.Base. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
OpenCAGE.ConfigEditors uses OpenCAGE.Popups.Base, so a change to OpenCAGE.Popups.Base can break OpenCAGE.ConfigEditors, while a change to OpenCAGE.ConfigEditors can't break OpenCAGE.Popups.Base.
Position
Below the diagonal: OpenCAGE.ConfigEditors uses a module listed above it, which is the healthy direction.
OpenCAGE.ConfigEditors uses OpenCAGE.Popups.Configuration_Editors.User_Controls, so a change to OpenCAGE.Popups.Configuration_Editors.User_Controls can break OpenCAGE.ConfigEditors, while a change to OpenCAGE.ConfigEditors can't break OpenCAGE.Popups.Configuration_Editors.User_Controls.
Position
Below the diagonal: OpenCAGE.ConfigEditors uses a module listed above it, which is the healthy direction.
20→26 OpenCAGE.ConfigEditors uses OpenCAGEpart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.ConfigEditors uses a type in OpenCAGE.
OpenCAGE.ConfigEditors uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.ConfigEditors, while a change to OpenCAGE.ConfigEditors can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
OpenCAGE.Modding uses OpenCAGE.Modding.Merging, so a change to OpenCAGE.Modding.Merging can break OpenCAGE.Modding, while a change to OpenCAGE.Modding can't break OpenCAGE.Modding.Merging.
Position
Below the diagonal: OpenCAGE.Modding uses a module listed above it, which is the healthy direction.
21→26 OpenCAGE.Modding uses OpenCAGEpart of a loop✕
Connections
1 pair of types, where a type in OpenCAGE.Modding uses a type in OpenCAGE.
The types involved
OpenCAGE.Modding.PakParts → OpenCAGE.TreeLayout
Direction
OpenCAGE.Modding uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.Modding, while a change to OpenCAGE.Modding can't break OpenCAGE.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
OpenCAGE.Popups.Configuration_Editors uses OpenCAGE.Popups.Base, so a change to OpenCAGE.Popups.Base can break OpenCAGE.Popups.Configuration_Editors, while a change to OpenCAGE.Popups.Configuration_Editors can't break OpenCAGE.Popups.Base.
Position
Below the diagonal: OpenCAGE.Popups.Configuration_Editors uses a module listed above it, which is the healthy direction.
OpenCAGE.Popups uses OpenCAGE.Popups.Base, so a change to OpenCAGE.Popups.Base can break OpenCAGE.Popups, while a change to OpenCAGE.Popups can't break OpenCAGE.Popups.Base.
Position
Below the diagonal: OpenCAGE.Popups uses a module listed above it, which is the healthy direction.
OpenCAGE.Popups uses OpenCAGE.Popups.UserControls, so a change to OpenCAGE.Popups.UserControls can break OpenCAGE.Popups, while a change to OpenCAGE.Popups can't break OpenCAGE.Popups.UserControls.
Position
Below the diagonal: OpenCAGE.Popups uses a module listed above it, which is the healthy direction.
OpenCAGE.Popups uses OpenCAGE.Modding, so a change to OpenCAGE.Modding can break OpenCAGE.Popups, while a change to OpenCAGE.Popups can't break OpenCAGE.Modding.
Position
Below the diagonal: OpenCAGE.Popups uses a module listed above it, which is the healthy direction.
23→26 OpenCAGE.Popups uses OpenCAGEpart of a loop✕
Connections
3 pairs of types, where a type in OpenCAGE.Popups uses a type in OpenCAGE.
OpenCAGE.DockPanels uses OpenCAGE.Popups.Base, so a change to OpenCAGE.Popups.Base can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.Popups.Base.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
OpenCAGE.DockPanels uses OpenCAGE.Popups.UserControls, so a change to OpenCAGE.Popups.UserControls can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.Popups.UserControls.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
OpenCAGE.DockPanels uses OpenCAGE.RuntimeUtilsConnection, so a change to OpenCAGE.RuntimeUtilsConnection can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.RuntimeUtilsConnection.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
OpenCAGE.DockPanels uses OpenCAGE.Scripts, so a change to OpenCAGE.Scripts can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.Scripts.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
OpenCAGE.DockPanels uses OpenCAGE.UserControls, so a change to OpenCAGE.UserControls can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.UserControls.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
OpenCAGE.DockPanels uses OpenCAGE.Popups, so a change to OpenCAGE.Popups can break OpenCAGE.DockPanels, while a change to OpenCAGE.DockPanels can't break OpenCAGE.Popups.
Position
Below the diagonal: OpenCAGE.DockPanels uses a module listed above it, which is the healthy direction.
24→26 OpenCAGE.DockPanels uses OpenCAGEpart of a loop✕
Connections
41 pairs of types, where a type in OpenCAGE.DockPanels uses a type in OpenCAGE. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
OpenCAGE.Undo uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.Undo, while a change to OpenCAGE.Undo can't break OpenCAGE.DockPanels.
Position
Below the diagonal: OpenCAGE.Undo uses a module listed above it, which is the healthy direction.
50 pairs of types, where a type in OpenCAGE uses a type in OpenCAGE.Popups.Base. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
OpenCAGE uses OpenCAGE.Popups.Base, so a change to OpenCAGE.Popups.Base can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.Popups.Base.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
OpenCAGE uses OpenCAGE.Popups.UserControls, so a change to OpenCAGE.Popups.UserControls can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.Popups.UserControls.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
OpenCAGE uses OpenCAGE.RuntimeUtilsConnection, so a change to OpenCAGE.RuntimeUtilsConnection can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.RuntimeUtilsConnection.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
OpenCAGE uses OpenCAGE.UserControls, so a change to OpenCAGE.UserControls can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.UserControls.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
OpenCAGE uses OpenCAGE.ConfigEditors, so a change to OpenCAGE.ConfigEditors can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.ConfigEditors.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
OpenCAGE uses OpenCAGE.Popups.Configuration_Editors, so a change to OpenCAGE.Popups.Configuration_Editors can break OpenCAGE, while a change to OpenCAGE can't break OpenCAGE.Popups.Configuration_Editors.
Position
Below the diagonal: OpenCAGE uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in OpenCAGE uses a type in OpenCAGE.DockPanels. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
AlienPAK uses OpenCAGE.Popups.UserControls, so a change to OpenCAGE.Popups.UserControls can break AlienPAK, while a change to AlienPAK can't break OpenCAGE.Popups.UserControls.
Position
Below the diagonal: AlienPAK uses a module listed above it, which is the healthy direction.
OpenCAGE.UnityConnection uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.UnityConnection, while a change to OpenCAGE.UnityConnection can't break OpenCAGE.DockPanels.
Position
Below the diagonal: OpenCAGE.UnityConnection uses a module listed above it, which is the healthy direction.
OpenCAGE.UnityConnection uses OpenCAGE, so a change to OpenCAGE can break OpenCAGE.UnityConnection, while a change to OpenCAGE.UnityConnection can't break OpenCAGE.
Position
Below the diagonal: OpenCAGE.UnityConnection uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.Backups, so a change to OpenCAGE.Backups can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.Backups.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.AnimTrees, so a change to OpenCAGE.AnimTrees can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.AnimTrees.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.RuntimeUtilsConnection, so a change to OpenCAGE.RuntimeUtilsConnection can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.RuntimeUtilsConnection.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.ConfigEditors, so a change to OpenCAGE.ConfigEditors can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.ConfigEditors.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.Modding, so a change to OpenCAGE.Modding can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.Modding.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
OpenCAGE.MCP uses OpenCAGE.DockPanels, so a change to OpenCAGE.DockPanels can break OpenCAGE.MCP, while a change to OpenCAGE.MCP can't break OpenCAGE.DockPanels.
Position
Below the diagonal: OpenCAGE.MCP uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in OpenCAGE.MCP uses a type in OpenCAGE. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
14
Medium
Roadmap
Top priorities: Resolve the 1 No automated tests finding(s) in Code Coverage; Add a CI workflow that builds and runs the test suite on every push/PR; Run what this repository's stack ships: CodeQL's csharp pack, or a .NET security analyzer package — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No automated tests finding(s) in Code Coverage.
Run what this repository's stack ships: CodeQL's csharp pack, or a .NET security analyzer package — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Resolve the 1 `ParseXML` spells `XML` where 12 names in the project spell it `Xml` finding(s) in Naming Consistency — start with EnumStringListViewItems.cs.
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 — 362
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 — 2375
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 — 214
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 3
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 63 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, 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 — 63 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2943 of 2951 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D4 Code Duplication — 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 161 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .cpp (83,726 lines, 29% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
D12 Dependency Hygiene — 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. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: `dotnet list package` exited 1 with no output.
D16 Bus Factor — 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. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 1462 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D17 Explicit Debt — 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 C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: Project file not found: 'Source/CathodeLib/CathodeLib/CathodeLib.csproj'.
D17 Explicit Debt — 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 428 deducted marker(s) and the 1.9/KLoC density on this row were taken over this repository's .NET projects ALONE: .cpp (83,726 lines, 29% of production source) went unread, because every marker collector on this path is reached through a C# workspace. D17's marker collectors need a compiler we do not have for that language, so none of its nine marker kinds were read there. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D18 Solution Shape — 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 build did not finish within its budget on this run; structural metrics are reported, build/warning status is unknown.
D19 Documentation 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
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.
D22 Internal API Consistency — 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. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
D23 Boundary Type-Coupling — 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. Large codebase (198,871 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D30 Dependency Vulnerabilities — measured, with a gap in what it reached — 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. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 1 of 2 declared ecosystem(s) (nuget packages.config) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
D32 Data Compliance (PII/GDPR) — 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. `Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs`, `Source/OpenCAGE/Scripts/MCP/McpTool.cs`, `Source/OpenCAGE/Scripts/ModelIO.cs` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX2 Stateful singletons — 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. 77 further occurrence(s) are not listed individually; the score already reflects all 117.
AX6 Interface segregation — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 2 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
IC1 Incompleteness & stubs — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
IC1 Incompleteness & stubs — 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. 49 further occurrence(s) are not listed individually; the score already reflects all 89.
P2 Observability — 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. 43 further occurrence(s) are not listed individually; the score already reflects all 83.
X1 Async correctness — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. 134 further occurrence(s) are not listed individually; the score already reflects all 174.
X12 Unreachable branch — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X13 Undrained process stream — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X15 Unvalidated length from an untrusted reader — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X16 Unfloored truncation loop — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X17 Uncapped recursion over a caller-supplied document — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X18 Disposal-pattern correctness — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X19 Unrestored process-global state — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X2 Cancellation propagation — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X21 Side-effecting pattern guard — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X22 Contradicted release guard — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X25 Inert configuration knob — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X26 Unsynchronised callback handoff — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X27 Collection changed while being enumerated — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X28 Index access outside its own emptiness guard — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X29 Per-element action decided by a fixed element — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. 350 further occurrence(s) are not listed individually; the score already reflects all 390.
X30 Support guard that admits what it rejects — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X7 Silent fallback defaults — 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. 72 further occurrence(s) are not listed individually; the score already reflects all 112.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
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.
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.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
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.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
ED5 Idempotency: Idempotency is read from the handler body and one hop below: a mutation is flagged only on structural double-apply evidence (a fresh-identity insert, an accumulation, a growing list, an unkeyed POST/send/charge), so a duplicate effect through a home-grown gateway two hops down, or an insert keyed on the message with no unique constraint, is not flagged but counted as not classified; a guard enforced by a database constraint or a broker's exactly-once delivery is invisible either way. It flags the at-least-once double-apply SHAPE, not a runtime proof of a duplicate effect.
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
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.
617 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was McpBrowseTools.FindEntities at 203. A further 30 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 AnimTreeCanvas.PinsOf at 34 — they are counted neither in the figure above nor in this dimension's score. 5 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Source/OpenCAGE/Scripts/Unity Connection/ViewerInboundDispatcher.cs (ViewerInboundDispatcher.Apply at 28), Source/OpenCAGE/Scripts/Textures/DdsFile.cs (DdsFile.FormatFor at 23), Source/OpenCAGE/Scripts/Modding/ModPackage.cs (ModPackage.IsSafeName at 18), Source/OpenCAGE/Scripts/Textures/TextureConverter.cs (TextureConverter.Describe at 18), Source/OpenCAGE/Scripts/ModelExport/ModelExporter.cs (ModelExporter.IsExactlyIdentity at 16). 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.
+ 610 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with McpBrowseTools.FindEntities (cyclomatic 203). — Refactoring it lifts Cyclomatic Complexity from 2.0 to about 2.1/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 812 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 104 bodies over 60 down to 60 or less in Cognitive Complexity — start with McpUsageTools.TraceLinks (cognitive 343), McpBrowseTools.FindEntities (cognitive 292), Geometry.Geometry.ctor (cognitive 211). — 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 104 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.
Do you agree with this assessment?
D3 · God Classes7.5 / 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.
Resolve the 87 MethodTooLong finding(s) in God Classes — start with McpAnimationAssetTools.cs (7), McpAssetTools.cs (6), McpCageAnimationTools.cs (6). — One of this dimension's main actionable groups (87 warning-level).
Resolve the 71 FileTooLong finding(s) in God Classes — start with McpAnimationAssetTools.cs, McpCageAnimationTools.cs, CommandsEditor.cs. — One of this dimension's main actionable groups (71 warning-level).
Resolve the 68 TooManyMethods finding(s) in God Classes — start with McpAssetTools.cs (2), CommandsEditor.cs, Flowgraph.cs. — One of this dimension's main actionable groups (68 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
161 duplicated block group(s) detected. 3.7 % of the production lines (7,332 of 198,871) are in a reported copy. A further 177 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .cpp (29% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.
+ 90 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 26 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with McpCageAnimationTools.cs (3), FlowgraphLayoutManager.cs (2), Program.cs. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 25 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with ImportCompositeArchive.cs (2), McpAnimationAssetTools.cs (2), EditModel.cs (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 15 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with McpServer.cs (2), LiveLink.cs, LevelEditorTables.cs. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with CommandsEditor.cs, ModelEditorControlsWPF.xaml.cs, Flowgraph.cs. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage0.0 / 10Critical✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: 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.
0 of 107 packages use a banned license. The depth of this set was not established for this repository: the graded packages are what this pass resolved, and no lockfile was read, so it is not certified to be the full transitive closure.
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.
Top hotspots: Source/OpenCAGE/CommandsEditor.cs (77×42=3234); Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs (32×97=3104); Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs (40×67=2680) Repeated repair below the complexity floor: Source/OpenCAGE/Popups/SelectHierarchy.cs (4 of 6 changes were fixes); Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs (3 of 5 changes were fixes)
Resolve the 89 Hotspot finding(s) in Churn × Complexity Hotspots — start with Program.cs (2), CommandsEditor.cs, McpLevelTools.cs. — One of this dimension's main actionable groups (89 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with SelectHierarchy.cs, GUI_ModelViewer.xaml.cs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
428 deducted debt markers + unmeasured dead symbols across 198871 LoC in the .NET projects (1.9/KLoC) → score 6.3. Dead code not measured: the solution did not load cleanly, so the reference search was skipped. Measured on the .NET source only: .cpp (29% of production source) was not read, and carries at least 0 uncounted task marker(s) in 0 file(s).
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 353 EmptyCatchBlock finding(s) in Explicit Debt — start with CommandsEditor.cs (17), Program.cs (13), ModManagerForm.cs (12). — One of this dimension's main actionable groups (353 issue-level).
Resolve the 7 WriteOnlyPrivateField finding(s) in Explicit Debt — start with BlendSetUserPicker.cs, SelectShaderPermutation.cs, CompositeTree.cs. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 32 TodoComment finding(s) in Explicit Debt — start with EntityInspector.cs (7), CompositeDisplay.cs (2), AddEntity_Variable.cs (2). — One of this dimension's main actionable groups (32 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
4 projects, 447 source files, 198871 hand-written lines of code (198871 production / 0 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), plus 32816 generated (machine-written code — designer, scaffolded and tool-emitted files — excluded from quality), 0 inter-project edges (build status unknown — did not finish).
Solution references 4 projects that do not existSource/OpenCAGE.sln
What to do
Resolve the 1 Solution references 4 projects that do not exist finding(s) in Solution Shape — start with OpenCAGE.sln. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d18_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 3 document(s) read across 5 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: 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.
No ADRs foundSource/Downloader/Downloader.csproj:8
What to do
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Downloader.csproj. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
2 naming inconsistencies among 33 declarations measured against a convention their peers follow.
`uiPAK` spells `PAK` where 20 names in the project spell it `Pak`Source/OpenCAGE/Popups/LaunchGame.cs:1018
`ParseXML` spells `XML` where 12 names in the project spell it `Xml`Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:514
What to do
Resolve the 1 `uiPAK` spells `PAK` where 20 names in the project spell it `Pak` finding(s) in Naming Consistency — start with LaunchGame.cs. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `ParseXML` spells `XML` where 12 names in the project spell it `Xml` finding(s) in Naming Consistency — start with EnumStringListViewItems.cs. — 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.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
2 of 4 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2Source/OpenCAGE/OpenCAGE.csproj:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with OpenCAGE.csproj, Downloader.csproj. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
14 finding(s): 0 critical, 0 high, 14 medium, 0 low. semgrep hit a parse error in 16 file(s) — `Source/OpenCAGE.RuntimeUtils/BT_DEBUG.h` (line 56, line 58, line 61, …), `Source/OpenCAGE.RuntimeUtils/CINEMATIC_CAMERA.h` (lines 63–112), `Source/OpenCAGE.RuntimeUtils/CUBEMAP_CAPTURE.h` (lines 52–92), `Source/OpenCAGE.RuntimeUtils/DEBUG_ACTIONS.h` (line 37, line 40), `Source/OpenCAGE.RuntimeUtils/GAME_SAVES.h`, … (+11 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.
REDACTED
REDACTED
What to do
Resolve the 12 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. 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.
No known-vulnerable dependencies in the 1 ecosystem(s) that were scanned (nuget packages.config). Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (nuget packages.config), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.
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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 376 of the 430 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with CommandsEditor.cs, McpLevelTools.cs, CompositeDisplay.cs. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.
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.
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.
`ErrorLog` keeps one instance of itself in the static `_open`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_groups, _shown; e.g. `_groups` at line 171). — Source/OpenCAGE/Popups/ErrorLog.cs:21
`LayoutTrim` is not registered, but `FlowgraphLayoutManager` creates it and keeps it in the static `_trimCapture`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_entries; e.g. `_entries` at line 180). — Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:164
`AnimationModeSession` keeps one instance of itself in the static `Current`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (Time, _gameTarget; e.g. `Time` at line 163). — Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:46
`EditMaterial` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_materialPopup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_initialMaterial, _samplerInfo, _suppressFeatureEvents, _sortedMaterials; e.g. `_initialMaterial` at line 71). — Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:35
`EditAnimations` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_animationPopup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_context, _animations, _filling, _set, _preview; e.g. `_context` at line 107). — Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:23
`SelectEnumString` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_soundPreview, OnSelected, _currentType, _filteredItems; e.g. `_soundPreview` at line 154). — Source/OpenCAGE/Popups/SelectEnumString.cs:27
`EditTexture` is not registered, but `TexturePopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_suppressMipChange, _selectedTexture, _suppressFlagChange, _suppressCubemapModeChange, _suppressSearchChanged, _cubemapViewer; e.g. `_suppressMipChange` at line 121). — Source/OpenCAGE/Popups/Resource Editors/EditTexture.MipBar.cs:21
`EditMaterialMapping` is not registered, but `MappingPopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (treeHelper, _indexToMapping, _listItemToMapping; e.g. `treeHelper` at line 40). — Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:14
`EditSpline` is not registered, but `SplinePopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_updatingList; e.g. `_updatingList` at line 58). — Source/OpenCAGE/Popups/EditSpline.cs:14
`FirstPaintThemeFilter` is not registered, but `ThemeManager` creates it and keeps it in the static `_paintFilter`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_settled; e.g. `_settled` at line 120). — Source/OpenCAGE/Scripts/Theming/ThemeManager.cs:84
`TabStripPainter` is not registered, but `ThemePainters` creates it and keeps it in the static `_tabControls`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_hoveredTab; e.g. `_hoveredTab` at line 439). — Source/OpenCAGE/Scripts/Theming/ThemePainters.cs:355
`EntitySearchScopeController` is not registered, but `GlobalEntitySearchScopeSettings` creates it and keeps it in the static `_controller`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_scopeChangedHandlers, _boundMenu; e.g. `_scopeChangedHandlers` at line 94). — Source/OpenCAGE/Scripts/GlobalEntitySearchScopeSettings.cs:47
`UndoStack` keeps one instance of itself in the static `Current`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_undo, _recordCount, _stampCount, _suspendDepth, _groupDepth, _group; e.g. `_undo` at line 162). — Source/OpenCAGE/Scripts/Undo/UndoStack.cs:15
`Client` is not registered, but `Send` creates it and keeps it in the static `_client`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_ws; e.g. `_ws` at line 31). — Source/OpenCAGE/Scripts/RuntimeUtils Connection/Client.cs:8
`Record` is not registered, but `ViewerScriptResync` creates it and keeps it in the static `_record`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_composites, Composites, Entities, Mappings; e.g. `_composites` at line 42). — Source/OpenCAGE/Scripts/Unity Connection/ViewerScriptResync.cs:30
`McpCall` is not registered, but `Connection` creates it and keeps it in the static `McpEditor._call`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (LastProgress; e.g. `LastProgress` at line 323). — Source/OpenCAGE/Scripts/MCP/McpTool.cs:281
`CompositeTree` is not registered, but the singleton `ImportCompositeArchive` creates it and keeps it in `_tree`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_readOnly, _items, _nested, _ticked, _filter, _implied; e.g. `_readOnly` at line 109). — Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:17
`LevelPicker` is not registered, but the singleton `ImportCompositeArchive` creates it and keeps it in `_levels`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_bulk; e.g. `_bulk` at line 38). — Source/OpenCAGE/Popups/UserControls/LevelPicker.cs:12
`AnimationPreview` is not registered, but the singleton `EditAnimations` creates it and keeps it in `_preview`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_viewer, _editMetadata, _clip, _skeleton, _model, _modelPicker; e.g. `_viewer` at line 107). — Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:24
`SoundPreviewPanel` is not registered, but the singleton `SelectEnumString` creates it and keeps it in `_soundPreview`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_eventName, _generation, _resolved, _updatingVariations, _audio, _player; e.g. `_eventName` at line 136). — Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:21
`TreeUtility` is not registered, but the singleton `EditTexture` creates it and keeps it in `_treeHelper`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_fileTree, _previewIds, _merged; e.g. `_fileTree` at line 61). — Source/OpenCAGE/Scripts/TreeUtility.cs:37
`Group` is not registered, but the singleton `UndoStack` creates it and keeps it in `_undo`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_edits, Label; e.g. `_edits` at line 401). — Source/OpenCAGE/Scripts/Undo/UndoStack.cs:385
`GUI_AnimationViewer` is not registered, but the singleton `AnimationPreview` creates it and keeps it in `_viewer`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_showBones, _showMesh, _rootMotion, _retarget, _submeshes, _skeleton; e.g. `_showBones` at line 30). — Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:21
`EditModel` is not registered, but the singleton `AnimationPreview` creates it and keeps it in `_modelPicker`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (allSubmeshes, treeHelper, modelViewer, checkboxToModelIndex, submeshCheckboxes, submeshRowInfoButtons; e.g. `allSubmeshes` at line 112). — Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:21
`SoundSeekBar` is not registered, but the singleton `SoundPreviewPanel` creates it and keeps it in `_seek`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_maximum, _buffered, _value, _dragging; e.g. `_maximum` at line 885). — Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:857
`EntityAddEdit` is not registered, but `AddEntity_CompositeInstance` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_removal; e.g. `_removal` at line 489). — Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:462
`CompositeAddEdit` is not registered, but `AddFolder` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_layouts; e.g. `_layouts` at line 55). — Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:17
`PagePresenceEdit` is not registered, but `Flowgraph` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_meta; e.g. `_meta` at line 126). — Source/OpenCAGE/Scripts/Undo/PageEdits.cs:89
`NodePresenceEdit` is not registered, but `Flowgraph` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_leftInPlace, _snapshot; e.g. `_leftInPlace` at line 198). — Source/OpenCAGE/Scripts/Undo/FlowgraphEdits.cs:166
`ParameterValueEdit` is not registered, but `Flowgraph` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_after, _modifiedAfter, _stamp; e.g. `_after` at line 164). — Source/OpenCAGE/Scripts/Undo/ParameterEdits.cs:89
`CageAnimationEdit` is not registered, but `CAGEAnimationEditor` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_after, _lengthMarkedAfter, _stamp; e.g. `_after` at line 216). — Source/OpenCAGE/Scripts/Undo/SessionEdits.cs:100
`EntityDeleteEdit` is not registered, but `ShowCrossRefs` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_aliases, _deletedOffScreen, _hadVerdict, _nodes, _pinInfo, _layoutTrim; e.g. `_aliases` at line 91). — Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:18
`CompositeDeleteEdit` is not registered, but `CompositeBrowser` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_removedFunctions, _prunedLinks, _removedAliases, _removedProxies, _removedPathEntries, _ownerPages; e.g. `_removedFunctions` at line 145). — Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:79
`PageLayoutEdit` is not registered, but `McpPageTools` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_before, _after; e.g. `_before` at line 287). — Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:265
`RefactorEdit` is not registered, but `McpScriptEdit` creates it and hands it to the singleton `UndoStack`, which keeps it in `_group`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_result, _pagesBefore, _pagesAfter, _addedPins; e.g. `_result` at line 81). — Source/OpenCAGE/Scripts/Undo/RefactorEdit.cs:19
`Data` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (dict; e.g. `dict` at line 39). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:27
`EditBlendSets` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_setsBefore, _usersBefore; e.g. `_setsBefore` at line 651). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:25
`PackageDropTarget` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_attached, _watched; e.g. `_attached` at line 21). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Source/OpenCAGE/Scripts/PackageDropTarget.cs:11
`PackageFiles` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (PendingOpen, _activeImport, _stashWatcher, _drainTimer; e.g. `PendingOpen` at line 85). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Source/OpenCAGE/Scripts/PackageFiles.cs:16
`CompositeIndexCache` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cache; e.g. `_cache` at line 138). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Source/OpenCAGE/Scripts/CompositeImporter.cs:105
What to do
Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
A `static` field is one slot for the whole process, however its type is created: back it with a thread-safe type (ConcurrentDictionary, Interlocked), take a lock around every write, or move it into a registered singleton that does.
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.
The namespaces AlienPAK ↔ OpenCAGE ↔ OpenCAGE.AnimTrees ↔ OpenCAGE.ConfigEditors ↔ OpenCAGE.DockPanels ↔ OpenCAGE.Modding ↔ OpenCAGE.Modding.Merging ↔ OpenCAGE.Popups ↔ OpenCAGE.Popups.Base ↔ OpenCAGE.Popups.Configuration_Editors ↔ OpenCAGE.Popups.Configuration_Editors.User_Controls ↔ OpenCAGE.Popups.UserControls ↔ OpenCAGE.RuntimeUtilsConnection ↔ OpenCAGE.Scripts ↔ OpenCAGE.Undo ↔ OpenCAGE.UserControls depend on each other. The lightest dependency in the cycle is AlienPAK → OpenCAGE.Popups.UserControls (AlienPAK.ModelImportPreview → OpenCAGE.Popups.UserControls.AssetNameBox, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — Source/OpenCAGE/Popups/Resource Editors/ModelImportPreview.cs:8
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
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.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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.
Other · Readiness — Whether retry-prone mutations (command handlers and message or event consumers) are idempotent, so an at-least-once redelivery or a client retry does not apply the effect twice.
Method: Roslyn (any mutation, ungated): each persistent write of a command handler or message/event consumer is idempotent when a guard is visible (an exists/dedup read that gates an exit, upsert, idempotency-key/inbox used in a condition or store call, versioned or fixed-value write, dedup envelope or pipeline), at risk only on positive double-apply evidence (a fresh-identity insert, an accumulation on a loaded and saved object, a growing member list, an unkeyed POST/SMTP send/Stripe charge), and otherwise not classified. Deterministic, no model; not scored when more than half are not classified. Advisory.
Coverage: Population: retry-prone mutations — command handlers (CQRS write side) + message/event consumers (IConsumer/I*EventHandler) — that mutate persistent state; runs on any repo with mutations, not only event-driven ones. Every mutation is classified exhaustively and deterministically: guarded, at risk on positive evidence, or not classified; the score is over the classified ones and is withheld when they are fewer than half.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 93 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Source/OpenCAGE/Scripts/EditorUtils.cs:104
Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 892 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. (×2) — Source/OpenCAGE/Scripts/EditorUtils.cs:897, Source/OpenCAGE/Scripts/EditorUtils.cs:903
Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 897 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Source/OpenCAGE/Scripts/EditorUtils.cs:903
Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 943 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Source/OpenCAGE/Scripts/EditorUtils.cs:949
The branch `if (McpScript.IsFolder(composite))` throws `McpError` while the member's other paths do the work — the branch was never written, so every input that reaches it fails at run time. Implement the branch, or reject the input where it enters with an exception that says it is not supported. — Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:219
The branch `if (McpScriptTools.IsFolderPlaceholder(instanced))` throws `McpError` while the member's other paths do the work — the branch was never written, so every input that reaches it fails at run time. Implement the branch, or reject the input where it enters with an exception that says it is not supported. — Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:541
A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×32) — Source/OpenCAGE/CommandsEditor.cs:112, Source/OpenCAGE/CommandsEditor.cs:115, Source/OpenCAGE/CommandsEditor.cs:123, …
5 consecutive lines of code sit inside a `/* … */` block — a block of code switched off rather than removed, which rots and confuses. Delete it (version control remembers). — Source/OpenCAGE/Popups/Anim Tree Editor/AnimationSets.cs:40
What to do
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
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.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
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.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 243 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:243
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1196 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1196
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1198 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1198
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1202 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1202
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1210 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1210
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1217 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1217
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1221 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1221
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1224 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1224
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1225 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1225
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1229 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1229
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1237 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1237
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1244 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1244
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1248 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1248
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1251 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1251
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1252 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1252
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1377 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1377
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1506 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1506
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1511 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1511
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1537 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1537
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1540 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1540
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1546 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1546
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1552 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1552
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1574 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1574
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1578 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1578
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1588 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1588
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1634 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1634
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1640 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1640
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1750 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1750
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1754 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1754
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1758 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1758
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1859 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1859
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1864 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1864
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1866 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1866
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1869 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1869
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1871 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1871
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1872 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1872
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1877 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1877
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1879 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1879
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1882 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1882
`Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1884 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — Source/OpenCAGE/Scripts/LocalDebug.cs:1884
What to do
Replace `Console.Write…` in service code with the project's injected `ILogger<T>` (message templates with named properties), so delivery outcomes and failures reach the log pipeline with a level and a category.
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.
No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`Source/OpenCAGE/packages.config` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — Source/OpenCAGE/packages.config:3
What to do
Run what this repository's stack ships: CodeQL's csharp pack, or a .NET security analyzer package — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
`new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out. — Source/OpenCAGE/Program.cs:556
What to do
Give every outbound call a bound the caller can rely on: set an explicit `HttpClient.Timeout` (or pass a `CancellationToken` from a `CancellationTokenSource` with a deadline) and flow the caller's own `CancellationToken` through, so a slow endpoint fails fast instead of hanging.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
14 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
`.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×10) — Source/OpenCAGE/CommandsEditor.cs:1977, Source/OpenCAGE/CommandsEditor.cs:1989, Source/OpenCAGE/Popups/ExportComposite.cs:130, …
`reading.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1389
`.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×3) — Source/OpenCAGE/Scripts/AnimationPakWrite.cs:103, Source/OpenCAGE/Program.cs:425, Source/OpenCAGE/Scripts/MCP/McpDebugger.cs:40
What to do
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself — a page handed to a consumer runs in that consumer's origin.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. (×4) — Source/OpenCAGE/Scripts/AlienLevel.cs:469, Source/OpenCAGE/Scripts/AlienLevel.cs:921, Source/OpenCAGE/Scripts/AnalyticsManager.cs:17, …
`https://unpkg.com/react@17/umd/react.development.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 7 such include(s) across the repository's markup. — Source/WebAPI/index.html:148
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name. This repository constructs a collision-broken hash (MD5/SHA1) at 4 sites, not one: `Source/OpenCAGE/Scripts/AlienLevel.cs:469` (MD5), `Source/OpenCAGE/Scripts/AlienLevel.cs:921` (MD5), `Source/OpenCAGE/Scripts/AnalyticsManager.cs:17` (SHA1Managed), `Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:1433` (SHA1). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Do you agree with this assessment?
X1 · Async correctness3.3 / 10Weak✓ Tool-verified
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
`async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained. (×9) — Source/OpenCAGE/CommandsEditor.cs:813, Source/OpenCAGE/CommandsEditor.cs:3256, Source/OpenCAGE/CommandsEditor.cs:3326, …
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×12) — Source/OpenCAGE/CommandsEditor.cs:1977, Source/OpenCAGE/CommandsEditor.cs:1989, Source/OpenCAGE/Popups/ExportComposite.cs:130, …
`CommandsEditor.SaveLevel` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). (×2) — Source/OpenCAGE/Popups/LevelBackupManager.cs:219, Source/OpenCAGE/Popups/LevelBackupManager.cs:372
`.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters). (×4) — Source/OpenCAGE/Scripts/PackageHandover.cs:256, Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5085, Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:598, …
Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout. (×4) — Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:68, Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:134, Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1760, …
`Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead. — Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:273
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader5.0 / 10Adequate✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`blobCount` is read from the stream being parsed at line 290 (`ReadInt32`), then used to size an array at line 291 — and nowhere in this method is `blobCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `blobCount` against the bytes actually remaining in the stream before spending it. — Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:291
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.8 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`Element` is public and takes the `XmlElement` from its caller, and it calls itself at line 641 with a child of the node it was given — and nowhere in `Element` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Element` can intervene. Thread a depth argument through `Element` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:641
`PathSteps` is public and takes the `JToken` from its caller, and it calls itself at line 366 with a child of the node it was given (and at line 367) — and nowhere in `PathSteps` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `PathSteps` can intervene. Thread a depth argument through `PathSteps` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — Source/OpenCAGE/Scripts/MCP/McpScript.cs:366
`ForClients` is public, takes a document from its caller (line 470) and hands it to `StripDeprecated`, which calls itself at line 510 with a child of the node it was given (and at line 515) — and nowhere in `StripDeprecated` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `ForClients` can intervene. Thread a depth argument through `StripDeprecated` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — Source/OpenCAGE/Scripts/MCP/McpTool.cs:510
`Canonical` is public, takes a document from its caller (line 583) and hands it to `Sorted`, which calls itself at line 594 with a child of the node it was given — and nowhere in `Sorted` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Canonical` can intervene. Thread a depth argument through `Sorted` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — Source/OpenCAGE/Scripts/MCP/McpTool.cs:594
`Check` is public, takes a document from its caller (line 648) and hands it to `Walk`, which calls itself at line 710 with a child of the node it was given (and at line 712, line 725) — and nowhere in `Walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Check` can intervene. Thread a depth argument through `Walk` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — Source/OpenCAGE/Scripts/MCP/McpTool.cs:710
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`stdin` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 116). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var stdin = …;`), which releases it at the end of the scope on every path including a throw. — Source/OpenCAGE.MCP/Program.cs:116
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/27 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — this work can't be stopped early once started. (×27) — Source/OpenCAGE/CommandsEditor.cs:3256, Source/OpenCAGE/CommandsEditor.cs:3326, Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:404, …
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
`ChildInstanceManager._processes` is a `Dictionary<…>` that a `Process.Exited +=` callback writes (`Remove` on line 114) and `Start` reads (line 104). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `Start` runs on whichever thread calls it. `Dictionary<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_processes`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context. — Source/OpenCAGE/Popups/UserControls/GameDirectory.cs:114
`SettingsManager._dirtyKeys` is a `HashSet<…>` that a `new Timer(…)` callback writes (`Remove` on line 563) and `MarkRemoved` reads (line 276). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `MarkRemoved` runs on whichever thread calls it. `HashSet<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_dirtyKeys`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context. — Source/OpenCAGE/Scripts/SettingsManager.cs:563
`SettingsManager._removedKeys` is a `HashSet<…>` that a `new Timer(…)` callback writes (`Remove` on line 566) and `MarkRemoved` reads (line 275). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `MarkRemoved` runs on whichever thread calls it. `HashSet<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_removedKeys`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context. — Source/OpenCAGE/Scripts/SettingsManager.cs:566
What to do
Hand values between a callback and the body waiting on it through a type built to be crossed — `System.Collections.Concurrent.ConcurrentQueue<T>` drops in beside the existing signal, and `System.Threading.Channels.Channel<T>` replaces the signal as well — or take a `lock` over every access to the shared collection on both sides. A counting semaphore beside it orders how MANY items exist and takes no exclusion over the collection's own internal state.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard7.4 / 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.
This access `latest[0]` has no test of the length of `latest` on its own path, while this method tests it for that position at line 2422 (`latest.Count != 0`): where that test fails, this read throws. Either the test is load-bearing and this read needs it too, or the length of `latest` is fixed here and the test is dead. — Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2423
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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×37) — Source/OpenCAGE/CommandsEditor.cs:434, Source/OpenCAGE/CommandsEditor.cs:481, Source/OpenCAGE/CommandsEditor.cs:564, …
`catch (ObjectDisposedException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — Source/OpenCAGE/CommandsEditor.cs:1332
`catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. (×2) — Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:309, Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:275
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 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.
SC1 Supply-chain hygiene — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
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.
AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AX1 Captive dependencies — no DI registrations detected
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
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D10 Test Quality — No tests were found in the analyzed repository to assess for quality.
D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
D12 Dependency Hygiene — Dependency hygiene not measured
D16 Bus Factor — single-contributor repository — bus factor is not applicable
D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
M4 Documentation accuracy — Not applicable: the 3 current-state document(s) make no claim of a kind M4 checks. 17 claim(s) of kinds M4 does not check were not checked (environment variable 17); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — no CI workflow found
P8 Schema migrations — no EF Core usage detected
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 — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
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.
X14 Bypassable address classification — 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
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 C# was read, and every log call in it goes through a logger that takes one finished message — its own wrapper, log4net, Console or Debug — so an interpolated message there loses nothing the API could have kept. Calls through Microsoft.Extensions.Logging, Serilog, NLog or ZLogger, or any logger with a message-template overload, would be judged.
X5 Nullable reference types — no NRT-eligible projects
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
EmptyCatchBlock Source/OpenCAGE.MCP/Program.cs:144— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE.MCP/Program.cs:485— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE.MCP/Program.cs:795— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE.MCP/Program.cs:983— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Mcp.cs:47— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Mcp.cs:48— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Undo.cs:46— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Undo.cs:47— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Undo.cs:70— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.Undo.cs:71— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:434— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:481— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:564— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:579— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:604— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:605— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:1349— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:1774— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:1782— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:2232— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:2261— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:3244— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:3380— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:3550— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock Source/OpenCAGE/CommandsEditor.cs:3850— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
WriteOnlyPrivateField Source/OpenCAGE/Popups/Resource Editors/BlendSetUserPicker.cs:27— private GlobalAnimClipDB.BlendSet _set — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Popups/Resource Editors/SelectShaderPermutation.cs:30— private SHADER_LIST _family — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:44— private DoubleClickGuard _guard — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Scripts/EmbeddedWindowHost.cs:20— private Process _process — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2150— private string[] PositionAxes — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:57— private ShortGuid NpcLogic — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Source/OpenCAGE/Scripts/ModelExport/FbxExporter.cs:34— private string _name — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
Namespace dependency cycle Source/OpenCAGE/Popups/Resource Editors/ModelImportPreview.cs:8— The namespaces AlienPAK ↔ OpenCAGE ↔ OpenCAGE.AnimTrees ↔ OpenCAGE.ConfigEditors ↔ OpenCAGE.DockPanels ↔ OpenCAGE.Modding ↔ OpenCAGE.Modding.Merging ↔ OpenCAGE.Popups ↔ OpenCAGE.Popups.Base ↔ OpenCAGE.Popups.Configuration_Editors ↔ OpenCAGE.Popups.Configuration_Editors.User_Controls ↔ OpenCAGE.Popups.UserControls ↔ OpenCAGE.RuntimeUtilsConnection ↔ OpenCAGE.Scripts ↔ OpenCAGE.Undo ↔ OpenCAGE.UserControls depend on each other. The lightest dependency in the cycle is AlienPAK → OpenCAGE.Popups.UserControls (AlienPAK.ModelImportPreview → OpenCAGE.Popups.UserControls.AssetNameBox, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
No automated tests — No automated tests — no test code was found in this repository. Untested code is the largest single risk to changing it safely. Start with the code you change most often: add a suite in a framework a runner can collect (xUnit, NUnit or MSTest), and run it in CI so the gap cannot reopen.
Hotspot: Source/OpenCAGE/CommandsEditor.cs Source/OpenCAGE/CommandsEditor.cs:2989— Source/OpenCAGE/CommandsEditor.cs changed 77 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in CommandsEditor.ApplyAllOptionCheckboxesFromSettings at line 2989. 14 of those changes were fix/bug commits, and the other 63 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/CommandsEditor.cs`: 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: Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:970— Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 97 in McpLevelTools.RuntimeUtils at line 970. 3 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs`: 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: Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:531— Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in EntityInspector.Reload at line 531. 11 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs`: 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: Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1178— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in Flowgraph.ContextMenu_Opening at line 1178. 11 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs`: 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: Source/OpenCAGE/Scripts/Modding/ModInstaller.cs Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1675— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in ModInstaller.ApplyConfigurationLocked at line 1675. 1 of those changes was a fix/bug commit, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/Modding/ModInstaller.cs`: 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: Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1545— Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in McpEditorTools.LaunchGame at line 1545. 5 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs`: 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: Source/OpenCAGE/Scripts/MCP/McpImportTools.cs Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:272— Source/OpenCAGE/Scripts/MCP/McpImportTools.cs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in McpImportTools.ImportModel at line 272. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/MCP/McpImportTools.cs`: 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: Source/OpenCAGE/DockPanels/CompositeDisplay.cs Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1930— Source/OpenCAGE/DockPanels/CompositeDisplay.cs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in CompositeDisplay.LoadEntity at line 1930. 16 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/DockPanels/CompositeDisplay.cs`: 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: Source/OpenCAGE/Scripts/EnumStringListViewItems.cs Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:189— Source/OpenCAGE/Scripts/EnumStringListViewItems.cs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in EnumStringListViewItems.AddItems at line 189. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/EnumStringListViewItems.cs`: 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: Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1591— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in McpAnimationAssetTools.ImportAnimation at line 1591. 4 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs`: 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: Source/OpenCAGE/Scripts/ModelIO.cs Source/OpenCAGE/Scripts/ModelIO.cs:280— Source/OpenCAGE/Scripts/ModelIO.cs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in ModelIO.BuildScene at line 280. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/ModelIO.cs`: 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: Source/OpenCAGE/Popups/ModExporterForm.cs Source/OpenCAGE/Popups/ModExporterForm.cs:419— Source/OpenCAGE/Popups/ModExporterForm.cs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in ModExporterForm.PopulateTree at line 419. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/ModExporterForm.cs`: 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: Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:788— Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in McpViewportTools.SetView at line 788. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs`: 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: Source/OpenCAGE/Scripts/NodeUtils.cs Source/OpenCAGE/Scripts/NodeUtils.cs:146— Source/OpenCAGE/Scripts/NodeUtils.cs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in NodeUtils.GetAllPinPositions at line 146. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/NodeUtils.cs`: 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: Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:411— Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ModExportBuilder.Summarise at line 411. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs`: 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: Source/OpenCAGE/Popups/ModManagerForm.cs Source/OpenCAGE/Popups/ModManagerForm.cs:1033— Source/OpenCAGE/Popups/ModManagerForm.cs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in ModManagerForm.ApplyChanges at line 1033. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/ModManagerForm.cs`: 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: Source/OpenCAGE/Scripts/LevelContent.cs Source/OpenCAGE/Scripts/LevelContent.cs:177— Source/OpenCAGE/Scripts/LevelContent.cs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in LevelContent.Save at line 177. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/LevelContent.cs`: 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: Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:612— Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in EditMaterial.materialList_SelectedIndexChanged at line 612. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs`: 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: Source/OpenCAGE/Popups/ExportComposite.cs Source/OpenCAGE/Popups/ExportComposite.cs:58— Source/OpenCAGE/Popups/ExportComposite.cs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ExportComposite.export_Click at line 58. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/ExportComposite.cs`: 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: Source/OpenCAGE/Program.cs Source/OpenCAGE/Program.cs:32— Source/OpenCAGE/Program.cs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Program.Main at line 32. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Program.cs`: 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: Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:346— Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in FlowgraphLayoutManager.TrimLayoutsForDeletion at line 346. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs`: 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: Source/OpenCAGE/Popups/LaunchGame.cs Source/OpenCAGE/Popups/LaunchGame.cs:894— Source/OpenCAGE/Popups/LaunchGame.cs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in LaunchGame.WriteScriptingHelpersConfig at line 894. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/LaunchGame.cs`: 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: Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:237— Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in EntityParameterProxy.BuildProperties at line 237. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs`: 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: Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:871— Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in EnumStringPopupEditor.EditValue at line 871. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs`: 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: Source/OpenCAGE/DockPanels/CompositeBrowser.cs Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1675— Source/OpenCAGE/DockPanels/CompositeBrowser.cs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in CompositeBrowser.FileTree_MouseDown at line 1675. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/DockPanels/CompositeBrowser.cs`: 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.
MethodTooLong: McpAnimationAssetTools.Tools Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:40— MethodTooLong — Tools runs 506 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 406 over it, 5.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.
MethodTooLong: McpEditorTools.Tools Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:29— MethodTooLong — Tools runs 340 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 240 over it, 3.40× 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: McpBrowseTools.FindEntities Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:779— MethodTooLong — FindEntities runs 316 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 216 over it, 3.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: McpAssetTools.Tools Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:23— MethodTooLong — Tools 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.
MethodTooLong: McpScriptTools.Tools Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:193— MethodTooLong — Tools runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.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: McpLevelTools.RuntimeUtils Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:970— MethodTooLong — RuntimeUtils runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NodeUtils.GetAllPinPositions Source/OpenCAGE/Scripts/NodeUtils.cs:146— MethodTooLong — GetAllPinPositions runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× 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: ModInstaller.ApplyConfigurationLocked Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1675— MethodTooLong — ApplyConfigurationLocked runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: McpUsageTools.TraceLinks Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:852— MethodTooLong — TraceLinks runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× 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: EnumStringListViewItems.AddItems Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:189— MethodTooLong — AddItems 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.
MethodTooLong: Geometry.Geometry(…) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:138— MethodTooLong — Geometry(…) runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EntityInspector.Reload Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:531— MethodTooLong — Reload runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.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.
MethodTooLong: McpBrowseTools.Tools Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:27— MethodTooLong — Tools runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: McpImportTools.ImportModel Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:272— MethodTooLong — ImportModel runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× 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: McpImportTools.Tools Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:24— MethodTooLong — Tools 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: McpCharacterTools.SpawnNpcTool Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1111— MethodTooLong — SpawnNpcTool runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.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.
MethodTooLong: McpResourceTools.Tools Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:28— MethodTooLong — Tools 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: McpViewportTools.SetView Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:788— MethodTooLong — SetView runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: McpLightTools.SetLights Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:537— MethodTooLong — SetLights 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: McpZoneTools.CheckZones Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2396— MethodTooLong — CheckZones 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.
MethodTooLong: McpCageAnimationTools.Tools Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:172— MethodTooLong — Tools runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.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.
MethodTooLong: McpSpatialTools.Loop Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1100— MethodTooLong — Loop runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.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.
MethodTooLong: EditMaterial.materialList_SelectedIndexChanged Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:612— MethodTooLong — materialList_SelectedIndexChanged runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: McpAnimationAssetTools.ImportAnimation Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1591— MethodTooLong — ImportAnimation runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× 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: McpSpatialTools.DropToFloor Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1549— MethodTooLong — DropToFloor runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.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.
FileTooLong: MCP/McpAnimationAssetTools.cs Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs— FileTooLong — 4052 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3552 over it, 8.10× 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: MCP/McpCageAnimationTools.cs Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs— FileTooLong — 2768 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2268 over it, 5.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: OpenCAGE/CommandsEditor.cs Source/OpenCAGE/CommandsEditor.cs— FileTooLong — 2703 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2203 over it, 5.41× 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 — 2109 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1609 over it, 4.22× 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: MCP/McpAssetTools.cs Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs— FileTooLong — 1989 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1489 over it, 3.98× 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: MCP/McpResourceTools.cs Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs— FileTooLong — 1957 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1457 over it, 3.91× 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: DockPanels/CompositeDisplay.cs Source/OpenCAGE/DockPanels/CompositeDisplay.cs— FileTooLong — 1919 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1419 over it, 3.84× 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: MCP/McpZoneTools.cs Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs— FileTooLong — 1814 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1314 over it, 3.63× 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: CAGEAnimation/CurveEditor.xaml.cs Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs— FileTooLong — 1771 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1271 over it, 3.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: MCP/McpViewportTools.cs Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs— FileTooLong — 1713 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1213 over it, 3.43× 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: MCP/McpEditorTools.cs Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs— FileTooLong — 1706 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1206 over it, 3.41× 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: MCP/McpLevelTools.cs Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs— FileTooLong — 1651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1151 over it, 3.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: MCP/McpScriptTools.cs Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs— FileTooLong — 1623 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1123 over it, 3.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: DockPanels/CompositeBrowser.cs Source/OpenCAGE/DockPanels/CompositeBrowser.cs— FileTooLong — 1622 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1122 over it, 3.24× 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: MCP/McpEditingTools.cs Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs— FileTooLong — 1543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1043 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: Scripts/ModelIO.cs Source/OpenCAGE/Scripts/ModelIO.cs— FileTooLong — 1444 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 944 over it, 2.89× 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: Composite Panels/Flowgraph.cs Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs— FileTooLong — 1375 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 875 over it, 2.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: MCP/McpCharacterTools.cs Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs— FileTooLong — 1364 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 864 over it, 2.73× 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: Modding/ModInstaller.cs Source/OpenCAGE/Scripts/Modding/ModInstaller.cs— FileTooLong — 1316 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 816 over it, 2.63× 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: MCP/McpSpatialTools.cs Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs— FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 793 over it, 2.59× 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: Function Editors/CAGEAnimationEditor.cs Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs— FileTooLong — 1250 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 750 over it, 2.50× 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: MCP/McpBrowseTools.cs Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs— FileTooLong — 1155 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 655 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: Composite Panels/EntityInspector.cs Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs— FileTooLong — 1102 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 602 over it, 2.20× 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: MCP/McpZonePlanner.Geometry.cs Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs— FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 547 over it, 2.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: crashes/index.php Source/WebAPI/crashes/index.php— FileTooLong — 1044 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 544 over it, 2.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.
TooManyMethods: CommandsEditor Source/OpenCAGE/CommandsEditor.cs— TooManyMethods — 2797 significant lines (blank, comment-only and punctuation-only lines excluded), 323 methods, declared across 3 files: OpenCAGE/CommandsEditor.cs (313), OpenCAGE/CommandsEditor.Mcp.cs (6), OpenCAGE/CommandsEditor.Undo.cs (4). The bar is 30 methods; this is 293 over it, 10.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Flowgraph Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs— TooManyMethods — 2598 significant lines (blank, comment-only and punctuation-only lines excluded), 219 methods, declared across 6 files: Composite Panels/Flowgraph.cs (121), Composite Panels/Flowgraph.Undo.cs (29), Composite Panels/Flowgraph.LiveLink.cs (20), Composite Panels/Flowgraph.Debugger.cs (18), +2 more file(s). The bar is 30 methods; this is 189 over it, 7.30× 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: CompositeDisplay Source/OpenCAGE/DockPanels/CompositeDisplay.cs— TooManyMethods — 2166 significant lines (blank, comment-only and punctuation-only lines excluded), 185 methods, declared across 3 files: DockPanels/CompositeDisplay.cs (165), DockPanels/CompositeDisplay.LiveLink.cs (11), DockPanels/CompositeDisplay.Debugger.cs (9). The bar is 30 methods; this is 155 over it, 6.17× 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: McpAnimationAssetTools Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs— TooManyMethods — 3820 significant lines (blank, comment-only and punctuation-only lines excluded), 153 methods. The bar is 30 methods; this is 123 over it, 5.10× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: CompositeBrowser Source/OpenCAGE/DockPanels/CompositeBrowser.cs— TooManyMethods — 1590 significant lines (blank, comment-only and punctuation-only lines excluded), 151 methods. The bar is 30 methods; this is 121 over it, 5.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.
TooManyMethods: CAGEAnimationEditor Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs— TooManyMethods — 1677 significant lines (blank, comment-only and punctuation-only lines excluded), 128 methods, declared across 2 files: Function Editors/CAGEAnimationEditor.cs (95), Function Editors/CAGEAnimationEditor.AnimationMode.cs (33). The bar is 30 methods; this is 98 over it, 4.27× 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: CurveEditor Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs— TooManyMethods — 1728 significant lines (blank, comment-only and punctuation-only lines excluded), 125 methods. The bar is 30 methods; this is 95 over it, 4.17× 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: McpCageAnimationTools Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs— TooManyMethods — 2594 significant lines (blank, comment-only and punctuation-only lines excluded), 119 methods. The bar is 30 methods; this is 89 over it, 3.97× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: McpGameDataTools REDACTED— TooManyMethods — 2066 significant lines (blank, comment-only and punctuation-only lines excluded), 117 methods. The bar is 30 methods; this is 87 over it, 3.90× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: McpZoneTools Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs— TooManyMethods — 2871 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods, declared across 3 files: MCP/McpZoneTools.cs (61), MCP/McpZoneTools.Model.cs (29), MCP/McpZoneTools.Plan.cs (14). The bar is 30 methods; this is 74 over it, 3.47× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ModelIO Source/OpenCAGE/Scripts/ModelIO.cs— TooManyMethods — 1207 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 30 methods; this is 58 over it, 2.93× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ModInstaller Source/OpenCAGE/Scripts/Modding/ModInstaller.cs— TooManyMethods — 1237 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 30 methods; this is 53 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: McpResourceTools Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs— TooManyMethods — 1767 significant lines (blank, comment-only and punctuation-only lines excluded), 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: EntityInspector Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs— TooManyMethods — 1156 significant lines (blank, comment-only and punctuation-only lines excluded), 79 methods, declared across 2 files: Composite Panels/EntityInspector.cs (73), Composite Panels/EntityInspector.LiveLink.cs (6). The bar is 30 methods; this is 49 over it, 2.63× 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: McpViewportTools Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs— TooManyMethods — 1647 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: McpScriptTools Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs— TooManyMethods — 1583 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: Send Source/OpenCAGE/Scripts/Unity Connection/Send.cs— TooManyMethods — 691 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: LaunchGame Source/OpenCAGE/Popups/LaunchGame.cs— TooManyMethods — 586 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: McpScriptEdit Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs— TooManyMethods — 906 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LiveLink Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs— TooManyMethods — 714 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, declared across 3 files: RuntimeUtils Connection/LiveLink.cs (55), RuntimeUtils Connection/LiveLinkDebugger.cs (2), RuntimeUtils Connection/LiveLinkErrors.cs (1). The bar is 30 methods; this is 28 over it, 1.93× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: McpEditorTools Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs— TooManyMethods — 1619 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: CompositeEntityList Source/OpenCAGE/Popups/UserControls/CompositeEntityList.cs— TooManyMethods — 732 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: EditModel Source/OpenCAGE/Popups/Resource Editors/EditModel.cs— TooManyMethods — 722 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: ModManagerForm Source/OpenCAGE/Popups/ModManagerForm.cs— TooManyMethods — 879 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ModExporterForm Source/OpenCAGE/Popups/ModExporterForm.cs— TooManyMethods — 850 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:434— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:481— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:564— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:579— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:604— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:605— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:1349— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:1774— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:1782— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:2232— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:2261— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:3244— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:3380— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:3550— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:3850— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:3910— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/CommandsEditor.cs:4327— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:287— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:322— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:341— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:383— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:441— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:197— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:334— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:396— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Stateful shared instance: ErrorLog Source/OpenCAGE/Popups/ErrorLog.cs:21— `ErrorLog` keeps one instance of itself in the static `_open`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_groups, _shown; e.g. `_groups` at line 171).
Stateful shared instance: LayoutTrim Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:164— `LayoutTrim` is not registered, but `FlowgraphLayoutManager` creates it and keeps it in the static `_trimCapture`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_entries; e.g. `_entries` at line 180).
Stateful shared instance: AnimationModeSession Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:46— `AnimationModeSession` keeps one instance of itself in the static `Current`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (Time, _gameTarget; e.g. `Time` at line 163).
Stateful shared instance: EditMaterial Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:35— `EditMaterial` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_materialPopup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_initialMaterial, _samplerInfo, _suppressFeatureEvents, _sortedMaterials; e.g. `_initialMaterial` at line 71).
Stateful shared instance: EditAnimations Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:23— `EditAnimations` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_animationPopup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_context, _animations, _filling, _set, _preview; e.g. `_context` at line 107).
Stateful shared instance: SelectEnumString Source/OpenCAGE/Popups/SelectEnumString.cs:27— `SelectEnumString` is not registered, but `EnumStringPopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_soundPreview, OnSelected, _currentType, _filteredItems; e.g. `_soundPreview` at line 154).
Stateful shared instance: EditTexture Source/OpenCAGE/Popups/Resource Editors/EditTexture.MipBar.cs:21— `EditTexture` is not registered, but `TexturePopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_suppressMipChange, _selectedTexture, _suppressFlagChange, _suppressCubemapModeChange, _suppressSearchChanged, _cubemapViewer; e.g. `_suppressMipChange` at line 121).
Stateful shared instance: EditMaterialMapping Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:14— `EditMaterialMapping` is not registered, but `MappingPopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (treeHelper, _indexToMapping, _listItemToMapping; e.g. `treeHelper` at line 40).
Stateful shared instance: EditSpline Source/OpenCAGE/Popups/EditSpline.cs:14— `EditSpline` is not registered, but `SplinePopupEditor` creates it and keeps it in the static `_popup`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_updatingList; e.g. `_updatingList` at line 58).
Stateful shared instance: FirstPaintThemeFilter Source/OpenCAGE/Scripts/Theming/ThemeManager.cs:84— `FirstPaintThemeFilter` is not registered, but `ThemeManager` creates it and keeps it in the static `_paintFilter`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_settled; e.g. `_settled` at line 120).
Stateful shared instance: TabStripPainter Source/OpenCAGE/Scripts/Theming/ThemePainters.cs:355— `TabStripPainter` is not registered, but `ThemePainters` creates it and keeps it in the static `_tabControls`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_hoveredTab; e.g. `_hoveredTab` at line 439).
Stateful shared instance: EntitySearchScopeController Source/OpenCAGE/Scripts/GlobalEntitySearchScopeSettings.cs:47— `EntitySearchScopeController` is not registered, but `GlobalEntitySearchScopeSettings` creates it and keeps it in the static `_controller`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_scopeChangedHandlers, _boundMenu; e.g. `_scopeChangedHandlers` at line 94).
Stateful shared instance: UndoStack Source/OpenCAGE/Scripts/Undo/UndoStack.cs:15— `UndoStack` keeps one instance of itself in the static `Current`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_undo, _recordCount, _stampCount, _suspendDepth, _groupDepth, _group; e.g. `_undo` at line 162).
Stateful shared instance: Client Source/OpenCAGE/Scripts/RuntimeUtils Connection/Client.cs:8— `Client` is not registered, but `Send` creates it and keeps it in the static `_client`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_ws; e.g. `_ws` at line 31).
Stateful shared instance: Record Source/OpenCAGE/Scripts/Unity Connection/ViewerScriptResync.cs:30— `Record` is not registered, but `ViewerScriptResync` creates it and keeps it in the static `_record`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_composites, Composites, Entities, Mappings; e.g. `_composites` at line 42).
Stateful shared instance: McpCall Source/OpenCAGE/Scripts/MCP/McpTool.cs:281— `McpCall` is not registered, but `Connection` creates it and keeps it in the static `McpEditor._call`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (LastProgress; e.g. `LastProgress` at line 323).
Stateful shared instance: CompositeTree Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:17— `CompositeTree` is not registered, but the singleton `ImportCompositeArchive` creates it and keeps it in `_tree`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_readOnly, _items, _nested, _ticked, _filter, _implied; e.g. `_readOnly` at line 109).
Stateful shared instance: LevelPicker Source/OpenCAGE/Popups/UserControls/LevelPicker.cs:12— `LevelPicker` is not registered, but the singleton `ImportCompositeArchive` creates it and keeps it in `_levels`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_bulk; e.g. `_bulk` at line 38).
Stateful shared instance: AnimationPreview Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:24— `AnimationPreview` is not registered, but the singleton `EditAnimations` creates it and keeps it in `_preview`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_viewer, _editMetadata, _clip, _skeleton, _model, _modelPicker; e.g. `_viewer` at line 107).
Stateful shared instance: SoundPreviewPanel Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:21— `SoundPreviewPanel` is not registered, but the singleton `SelectEnumString` creates it and keeps it in `_soundPreview`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_eventName, _generation, _resolved, _updatingVariations, _audio, _player; e.g. `_eventName` at line 136).
Stateful shared instance: TreeUtility Source/OpenCAGE/Scripts/TreeUtility.cs:37— `TreeUtility` is not registered, but the singleton `EditTexture` creates it and keeps it in `_treeHelper`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_fileTree, _previewIds, _merged; e.g. `_fileTree` at line 61).
Stateful shared instance: Group Source/OpenCAGE/Scripts/Undo/UndoStack.cs:385— `Group` is not registered, but the singleton `UndoStack` creates it and keeps it in `_undo`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_edits, Label; e.g. `_edits` at line 401).
Stateful shared instance: GUI_AnimationViewer Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:21— `GUI_AnimationViewer` is not registered, but the singleton `AnimationPreview` creates it and keeps it in `_viewer`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_showBones, _showMesh, _rootMotion, _retarget, _submeshes, _skeleton; e.g. `_showBones` at line 30).
Stateful shared instance: EditModel Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:21— `EditModel` is not registered, but the singleton `AnimationPreview` creates it and keeps it in `_modelPicker`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (allSubmeshes, treeHelper, modelViewer, checkboxToModelIndex, submeshCheckboxes, submeshRowInfoButtons; e.g. `allSubmeshes` at line 112).
Stateful shared instance: SoundSeekBar Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:857— `SoundSeekBar` is not registered, but the singleton `SoundPreviewPanel` creates it and keeps it in `_seek`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_maximum, _buffered, _value, _dragging; e.g. `_maximum` at line 885).
TodoComment Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:534— //TODO: The performance here is pretty poor. I should swap to using the PropertyGrid. — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:549— //UI defaults - TODO: just set this in the designer. — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:650— //TODO: we should have a custom display for these. it's kinda weird to have parameters of parameters in this UI — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:676— //editFunction.Text = "Alias Overrides"; //TODO: show count? — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:781— //TODO: this should also factor in links in/out - if a link already exists then we shouldn't add it as a param (or it should add it and highlight it as such) — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1222— //TODO: we have an issue here where this can be called after the entitydisplay object has been disposed — 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1739— //TODO: I think this is only valid for entities with "custom_character_type" set - but working that out requires a complex parse of connected entities. So ignoring for now. — 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 Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:93— //todo: i feel like these events should come from the compositedisplay? — 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 Source/OpenCAGE/DockPanels/CompositeDisplay.cs:76— //TODO: if the composite is modified, store the modification info in CompositeUtils.SetModificationInfo -> need to add the concept of "modifying" the composite first though, which should be done off of events when deleting/adding stuff (can also show this state in the UI) — 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 Source/OpenCAGE/DockPanels/CompositeDisplay.cs:106— //todo: tabs should be smaller — 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 Source/OpenCAGE/Popups/AddEntity_Variable.cs:78— //TODO: verify the ones that aren't listed here are definitely float — 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 Source/OpenCAGE/Popups/AddEntity_Variable.cs:112— //todo: this should be applied above... — 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 Source/OpenCAGE/Popups/AddOrEditResource.cs:21— //TODO: this whole resource editor needs a bit of a rework & improvement as it's not good enough. — 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 Source/OpenCAGE/Popups/Configuration Editors/LocalisationEditor.cs:12— // todo - when i implement this i need to add it to the backup tool (?) — 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 Source/OpenCAGE/Popups/Configuration Editors/ScriptReadableVariableEditor.cs:22— // todo - when i implement this i need to add it to the backup tool — 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 Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:1837— //TODO: even though the base game doesn't use other datatypes in anims, we probably can! — 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 Source/OpenCAGE/Popups/Function Editors/TriggerSequenceEditor.cs:21— //TODO: I should add pins to all TriggerSequence nodes for any new methods that are added here. — 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 Source/OpenCAGE/Popups/SelectDestinationPin.cs:111— //todo: should really validate (e.g. inputs cant connect to inputs) — 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 Source/OpenCAGE/Popups/SelectEnumString.cs:240— //TODO: if the type changes via the list box, this will error. Not using it currently, but note for if we do. — 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 Source/OpenCAGE/Popups/SelectEnumString.cs:413— //TODO: if Animation, maybe we also want to update AnimationSet? — 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 Source/OpenCAGE/Popups/SelectHierarchy.cs:168— //TODO: should use the proper hierarchy class here — 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 Source/OpenCAGE/Scripts/AlienLevel.cs:33— //TODO: change this to write the contents out to external files so we don't have to load everything every time — 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 Source/OpenCAGE/Scripts/AlienLevel.cs:69— //TODO - i should compress saved backups to prevent bloating disk space. i'll need to add in support for old uncompressed backups too. — 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 Source/OpenCAGE/Scripts/EditorUtils.cs:149— //TODO: reduce the need for this fiddling — 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 Source/OpenCAGE/Scripts/LevelContent.cs:30— //TODO: this should really be refactored. hacked in legacy stuff. — 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.
+ 7 more in this group — see findings.md.
X2 · Cancellation propagation· Async method without CancellationToken · ×27
Async method without CancellationToken: TryConnectLiveLink Source/OpenCAGE/CommandsEditor.cs:3256— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: RefreshLiveLinkMenu Source/OpenCAGE/CommandsEditor.cs:3326— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: PollStates Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:404— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: saveBackup_Click Source/OpenCAGE/Popups/LevelBackupManager.cs:200— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: backupAllNow_Click Source/OpenCAGE/Popups/LevelBackupManager.cs:364— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: PrepareAsync Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:359— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: UploadCrashLog Source/OpenCAGE/Program.cs:552— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Request Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:130— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetCamera Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:703— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetAnimation Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:826— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetTrace Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:978— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: WaitForPushes Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:1276— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Flush Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:1337— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Step Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:296— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: WaitOutRefusal Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:397— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Step Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:352— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Follow Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:479— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Toggle Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:283— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Clear Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:318— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: RemoveMethods Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:379— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Pump Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:775— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Poll Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:799— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Pump Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:173— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Step Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:376— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: WaitOutRefusal Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:533— No CancellationToken parameter — this work can't be stopped early once started.
Duplicated block (6 lines × 2) Source/OpenCAGE.MCP/Program.cs:940— Source/OpenCAGE.MCP/Program.cs:940-945 | Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:458-463 — 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 `Source/OpenCAGE.MCP/Program.cs:940` 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 (6 lines × 2) Source/OpenCAGE/Scripts/EditorUtils.cs:408— Source/OpenCAGE/Scripts/EditorUtils.cs:408-413 | Source/OpenCAGE/Scripts/EditorUtils.cs:428-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 `Source/OpenCAGE/Scripts/EditorUtils.cs:408` 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) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:826— Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:826-831 | Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:841-846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:59— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:59-64 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:660-665 — 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 `Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:59` 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) Source/OpenCAGE/Scripts/MaterialApplier.cs:825— Source/OpenCAGE/Scripts/MaterialApplier.cs:825-830 | Source/OpenCAGE/Scripts/MaterialApplier.cs:834-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:94— Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:94-99 | Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:342-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:94` 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) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3223— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3223-3228 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3892-3897 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3223` 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) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2770— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2770-2775 | Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2794-2799 — both copies are in the same file, so extract the 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 (6 lines × 2) Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:197— Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:197-202 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:205-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/Modding/PakParts.cs:309— Source/OpenCAGE/Scripts/Modding/PakParts.cs:309-314 | Source/OpenCAGE/Scripts/Modding/PakParts.cs:324-329 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Modding/PakParts.cs:309` 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) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1122— Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1122-1127 | Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1220-1225 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1122` 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) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1174— Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1174-1179 | Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1195-1200 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1174` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1172` calls `OrderBy`, `ToString`, `ThenBy` and `Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1194` 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 (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1734— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1734-1744 | Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3084-3089 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) REDACTED:1145— REDACTED:1145-1150 | REDACTED:1494-1499 — both copies are in the same file, so extract the 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:1145` 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) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1464— Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1464-1469 | Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1659-1667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:372— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:372-377 | Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:889-894 — 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 `Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:372` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1128— Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1128-1133 | Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1151-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1157` calls `Clone` and `Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1134` 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 (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:822— Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:822-827 | Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:833-838 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2878— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2878-2883 | Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:759-764 — 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) Source/OpenCAGE/CommandsEditor.Undo.cs:95— Source/OpenCAGE/CommandsEditor.Undo.cs:95-100 | Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2124-2129 — 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) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:949— Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:949-954 | Source/OpenCAGE/Scripts/Audio/SoundImport.cs:640-645 — 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.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/Modding/DeltaCodec.cs:127— Source/OpenCAGE/Scripts/Modding/DeltaCodec.cs:127-132 | Source/OpenCAGE/Scripts/Modding/VanillaManifest.cs:135-142 — 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 (6 lines × 2) REDACTED:306— REDACTED:306-311 | REDACTED:427-432 — 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) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:772— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:772-777 | Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:632-637 — 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.
Duplicated block (6 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3931— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3931-3937 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:351-356 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1120— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1120-1124 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3667-3671 — 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 `Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1120` 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) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1388— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1388-1392 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1449-1453 — both copies are in the same file, so extract the 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 `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 (5 lines × 2) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:396— Source/OpenCAGE/Popups/ImportCompositeArchive.cs:396-400 | Source/OpenCAGE/Popups/ImportComposites.cs:329-333 — 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) Source/OpenCAGE/Scripts/CompositeImporter.cs:272— Source/OpenCAGE/Scripts/CompositeImporter.cs:272-276 | Source/OpenCAGE/Scripts/LoadedGameFiles.cs:400-404 — 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1311— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1311-1315 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1340-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:180— REDACTED:180-184 | REDACTED:882-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 `REDACTED: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) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1104— Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1104-1108 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2060-2064 — 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 `Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1104` 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2633— Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2633-2637 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2678-2682 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2633` 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, `Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2638` calls `Contains` and `Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2683` 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 (5 lines × 2) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:477— Source/OpenCAGE/Popups/ImportCompositeArchive.cs:477-481 | Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1077-1081 — 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 (5 lines × 2) Source/OpenCAGE/Scripts/LevelEditorTables.cs:54— Source/OpenCAGE/Scripts/LevelEditorTables.cs:54-58 | Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:552-556 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/Scripts/LevelEditorTables.cs:53` calls `WriteTable` and `Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:551` 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 (5 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:132— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:132-136 | Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:141-145 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:141` 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1291— Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1291-1295 | Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1296-1300 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1291` 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:156— Source/OpenCAGE/Scripts/MCP/McpCollision.cs:156-160 | Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1016-1020 — 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) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1134— Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1134-1138 | Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1145-1149 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:875— Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:875-879 | Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:1048-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:191— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:191-195 | Source/OpenCAGE/Popups/SelectComposite.cs:132-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (5 lines × 2) Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:123— Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:123-127 | Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs:131-135 — before extracting anything, compare `Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs` and `Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:1142— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:1142-1146 | Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:276-280 — 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.
Duplicated block (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2861— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2861-2865 | Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:742-746 — 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:803— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:803-807 | Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1604-1608 — 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) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:88— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:88-92 | Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:27-31 — 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1572— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1572-1576 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:270-274 — 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 (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1468— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1468-1472 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:672-676 — 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 `Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1468` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:573— Source/OpenCAGE/Scripts/MCP/McpRegion.cs:573-577 | Source/OpenCAGE/Scripts/MCP/McpTool.cs:810-814 — 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 `Source/OpenCAGE/Scripts/MCP/McpRegion.cs:573` 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) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1430— Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1430-1434 | Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1439-1443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×15
Edited copy of a member (8 corresponding lines) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:215— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:215-222 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1081-1090 — 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) Source/OpenCAGE/Scripts/LevelEditorTables.cs:52— Source/OpenCAGE/Scripts/LevelEditorTables.cs:52-59 | Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:551-558 — 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) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:829— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:829-837 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:839-846 — 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) Source/OpenCAGE/Scripts/MaterialApplier.cs:26— Source/OpenCAGE/Scripts/MaterialApplier.cs:26-33 | Source/OpenCAGE/Scripts/MaterialApplier.cs:56-63 — 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) Source/OpenCAGE/Popups/AddOrEditLink.cs:140— Source/OpenCAGE/Popups/AddOrEditLink.cs:140-147 | Source/OpenCAGE/Popups/AddOrEditLink.cs:154-161 — 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) Source/OpenCAGE/Scripts/Modding/ModToolkit.cs:19— Source/OpenCAGE/Scripts/Modding/ModToolkit.cs:19-26 | Source/OpenCAGE/Scripts/Modding/ModToolkit.cs:29-36 — 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) Source/OpenCAGE/Scripts/Modding/VanillaConfigs.cs:22— Source/OpenCAGE/Scripts/Modding/VanillaConfigs.cs:22-36 | Source/OpenCAGE/Popups/ResetConfigs.cs:229-236 — 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) Source/OpenCAGE/Scripts/MCP/McpServer.cs:181— Source/OpenCAGE/Scripts/MCP/McpServer.cs:181-188 | Source/OpenCAGE.MCP/Program.cs:607-614 — 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkActivity.cs:560— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkActivity.cs:560-567 | Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:334-341 — 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) Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:38— Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:38-48 | Source/OpenCAGE/Popups/Configuration Editors/AmmoEditor.cs: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) Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:39— Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:39-46 | Source/OpenCAGE/Popups/Configuration Editors/SenseEditor.cs:40-47 — 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) Source/OpenCAGE/Scripts/MCP/McpServer.cs:224— Source/OpenCAGE/Scripts/MCP/McpServer.cs:224-231 | Source/OpenCAGE.MCP/Program.cs:805-812 — 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) Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:608— Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:608-615 | Source/OpenCAGE/Scripts/CAGE Animation/CageAnimationDrivers.cs:211-218 — 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2152— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2152-2159 | Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:684-694 — 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) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4612— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4612-4619 | REDACTED:279-288 — 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.
Sync-over-async blocking — 14 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/CommandsEditor.cs:1977— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/CommandsEditor.cs:1989— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Popups/ExportComposite.cs:130— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Popups/ImportCompositeArchive.cs:461— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1389— `reading.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:69— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:70— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:77— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:168— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:169— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/AnimationPakWrite.cs:103— `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/BulkExport.cs:191— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Program.cs:425— `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking Source/OpenCAGE/Scripts/MCP/McpDebugger.cs:40— `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
ClassTooLong: McpBrowseTools Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs— ClassTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 740 over it, 2.85× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpPortingTools Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs— ClassTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 431 over it, 2.08× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpMaterialTools REDACTED— ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 312 over it, 1.78× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpUsageTools Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs— ClassTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 310 over it, 1.78× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpLightTools Source/OpenCAGE/Scripts/MCP/McpLightTools.cs— ClassTooLong — 669 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 269 over it, 1.67× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpCameraTools Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs— ClassTooLong — 637 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 237 over it, 1.59× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: McpCollision Source/OpenCAGE/Scripts/MCP/McpCollision.cs— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 89 over it, 1.22× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: LevelSoundOverride Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs— ClassTooLong — 476 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 76 over it, 1.19× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: SoundPreviewPanel Source/OpenCAGE/UserControls/SoundPreviewPanel.cs— ClassTooLong — 468 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 68 over it, 1.17× 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: LevelSoundImportDialog Source/OpenCAGE/Popups/LevelSoundImportDialog.cs— ClassTooLong — 443 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 43 over it, 1.11× 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: McpSoundTools Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs— ClassTooLong — 420 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 20 over it, 1.05× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: CompositeArchive Source/OpenCAGE/Scripts/CompositeArchive.cs— ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 15 over it, 1.04× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: ThemeEngine Source/OpenCAGE/Scripts/Theming/ThemeEngine.cs— ClassTooLong — 408 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 8 over it, 1.02× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×12
Edited copy of a member (9 corresponding lines) Source/OpenCAGE/Scripts/AnimationRetarget.cs:458— Source/OpenCAGE/Scripts/AnimationRetarget.cs:458-466 | Source/OpenCAGE/Scripts/AnimationRetarget.cs: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) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1468— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1468-1476 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:672-680 — 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) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Undo.cs:568— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Undo.cs:568-576 | Source/OpenCAGE/Scripts/NodeUtils.cs:948-964 — 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) Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:513— Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:513-521 | Source/OpenCAGE/Scripts/CAGE Animation/CageAnimationDrivers.cs:232-240 — 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) Source/OpenCAGE/Scripts/MaterialGenerator.cs:855— Source/OpenCAGE/Scripts/MaterialGenerator.cs:855-863 | REDACTED:336-344 — 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) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:238— Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:238-246 | Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:369-378 — 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) Source/OpenCAGE/Scripts/MaterialGenerator.cs:1299— Source/OpenCAGE/Scripts/MaterialGenerator.cs:1299-1309 | REDACTED:790-798 — 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) Source/OpenCAGE/Scripts/Modding/PakParts.cs:585— Source/OpenCAGE/Scripts/Modding/PakParts.cs:585-595 | REDACTED:565-573 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:792— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:792-800 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:247-255 — 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) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1779— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1779-1787 | Source/OpenCAGE/DockPanels/EntityBrowser.cs:241-249 — 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) Source/OpenCAGE/Scripts/ModelIO.cs:908— Source/OpenCAGE/Scripts/ModelIO.cs:908-916 | Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:640-648 — 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) Source/OpenCAGE/Scripts/MCP/McpServer.cs:453— Source/OpenCAGE/Scripts/MCP/McpServer.cs:453-461 | Source/OpenCAGE.MCP/Program.cs:235-243 — 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.
Duplicated block (8 lines × 2) Source/OpenCAGE/Popups/AddComposite.cs:57— Source/OpenCAGE/Popups/AddComposite.cs:57-64 | Source/OpenCAGE/Popups/RenameComposite.cs:54-61 — 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 `Source/OpenCAGE/Popups/AddComposite.cs: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) Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:90— Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:90-97 | Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:141-148 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Source/OpenCAGE/Scripts/MaterialApplier.cs:685— Source/OpenCAGE/Scripts/MaterialApplier.cs:685-692 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1384-1391 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:685` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Source/OpenCAGE/Scripts/MaterialApplier.cs:695` calls `GetParameterType` and `Source/OpenCAGE/Scripts/MaterialApplier.cs:1393` 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 (8 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:834— Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:834-841 | Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:947-954 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:834` 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) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:561— Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:561-568 | Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:581-588 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:561` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:427— Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:427-434 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:555-562 — both copies are in the same file, so extract the 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) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:134— Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:134-141 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:226-233 — 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) Source/OpenCAGE/Scripts/MaterialApplier.cs:457— Source/OpenCAGE/Scripts/MaterialApplier.cs:457-464 | Source/OpenCAGE/Scripts/MaterialApplier.cs:466-473 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:457` 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) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Undo.cs:360— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Undo.cs:360-367 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Undo.cs: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.
Duplicated block (8 lines × 2) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2078— Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2078-2088 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2451-2458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:248— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:248-255 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:793-800 — 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 (8 lines × 2) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1780— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1780-1787 | Source/OpenCAGE/DockPanels/EntityBrowser.cs:242-249 — 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.
Sync-over-async (deadlock risk) Source/OpenCAGE/CommandsEditor.cs:1977— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/CommandsEditor.cs:1989— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Popups/ExportComposite.cs:130— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:461— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:69— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:70— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:77— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:168— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:169— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/BulkExport.cs:191— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Program.cs:422— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Source/OpenCAGE/Scripts/MCP/McpDebugger.cs:40— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×10
Edited copy of a member (15 corresponding lines) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1280— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1280-1295 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:279-293 — 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) Source/OpenCAGE/Scripts/InstanceTransform.cs:34— Source/OpenCAGE/Scripts/InstanceTransform.cs:34-51 | Source/OpenCAGE/Scripts/InstanceTransform.cs:74-88 — 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2688— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2688-2703 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:401-415 — 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) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:377— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:377-395 | Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:450-464 — 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) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3380— Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3380-3394 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:2079-2095 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:400— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:400-414 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:919-934 — 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) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:959— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:959-975 | Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2334-2348 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:380— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:380-394 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:118-133 — 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) Source/OpenCAGE/Popups/ModManagerForm.cs:66— Source/OpenCAGE/Popups/ModManagerForm.cs:66-83 | Source/OpenCAGE/Popups/ModExporterForm.cs:147-161 — 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) Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:19— Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:19-35 | Source/OpenCAGE/Popups/Configuration Editors/User Controls/SenseSet.cs:20-34 — 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· Edited copy of a member (7 corresponding lines) · ×10
Edited copy of a member (7 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:554— Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:554-560 | Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:844-850 — 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) Source/OpenCAGE/Scripts/ModelIO.cs:91— Source/OpenCAGE/Scripts/ModelIO.cs:91-98 | Source/OpenCAGE/Scripts/AnimationImport.cs:174-180 — 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) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:811— Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:811-817 | Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:758-773 — 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) REDACTED:102— REDACTED:102-108 | REDACTED:136-143 — 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) Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:402— Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:402-409 | Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:1226-1232 — 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) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:771— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:771-777 | Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:631-637 — 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) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:948— Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:948-954 | Source/OpenCAGE/Scripts/Audio/SoundImport.cs:639-645 — 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) REDACTED:408— REDACTED:408-414 | REDACTED:296-302 — 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2668— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2668-2674 | Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2678-2684 — 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) REDACTED:305— REDACTED:305-311 | REDACTED:426-432 — 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.
Duplicated block (9 lines × 2) Source/OpenCAGE/Popups/ExportComposite.cs:132— Source/OpenCAGE/Popups/ExportComposite.cs:132-140 | Source/OpenCAGE/Popups/ImportCompositeArchive.cs:470-478 — 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 `Source/OpenCAGE/Popups/ExportComposite.cs:132` 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 after the matched lines, `Source/OpenCAGE/Popups/ImportCompositeArchive.cs:480` calls `FirstOrDefault`, `Where`, `ToList` and `Source/OpenCAGE/Popups/ExportComposite.cs:142` 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) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:860— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:860-868 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1617-1625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:860` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1626` calls `IsFinite` and `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:869` 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) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:208— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:208-216 | Source/OpenCAGE/Popups/SelectComposite.cs:149-157 — 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.
Duplicated block (9 lines × 2) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:498— Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:498-506 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:723-731 — 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 `Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:498` 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 (9 lines × 2) Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:74— Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:74-82 | Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:125-133 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:74` 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1868— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1868-1876 | REDACTED:509-517 — 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 `Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1868` 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 (9 lines × 2) Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:451— Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:451-459 | Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:431-439 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:695— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:695-703 | Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:717-725 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:717` 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 (9 lines × 2) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:706— Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:706-714 | Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:871-879 — 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 `Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:706` 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) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:514— Source/OpenCAGE/Scripts/MCP/McpRegion.cs:514-522 | Source/OpenCAGE/Scripts/MCP/McpTool.cs:775-783 — 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 `Source/OpenCAGE/Scripts/MCP/McpRegion.cs:514` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×9
Edited copy of a member (10 corresponding lines) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:428— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:428-443 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:447-456 — 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) Source/OpenCAGE/Scripts/AnimationRetarget.cs:572— Source/OpenCAGE/Scripts/AnimationRetarget.cs:572-581 | Source/OpenCAGE/Scripts/AnimationRetarget.cs:870-881 — 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) Source/OpenCAGE/Scripts/EditorUtils.cs:116— Source/OpenCAGE/Scripts/EditorUtils.cs:116-125 | Source/OpenCAGE/Scripts/EditorUtils.cs:129-138 — 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) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:484— Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:484-493 | Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:496-505 — 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1032— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1032-1041 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1045-1055 — 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) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:1304— Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:1304-1313 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:1317-1326 — 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveSettings.cs:127— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveSettings.cs:127-138 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveSettings.cs:320-329 — 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) Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:467— Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:467-476 | Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:287-296 — 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) Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:459— Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:459-468 | Source/OpenCAGE/Popups/UserControls/FunctionTypeList.cs:198-207 — 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.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×9
Edited copy of a member (11 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:423— Source/OpenCAGE/Scripts/MCP/McpCollision.cs:423-433 | Source/OpenCAGE/Scripts/MCP/McpCollision.cs:698-709 — 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) Source/OpenCAGE/Scripts/Modding/PakParts.cs:547— Source/OpenCAGE/Scripts/Modding/PakParts.cs:547-560 | Source/OpenCAGE/Scripts/Modding/PakParts.cs:563-573 — 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) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:625— Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:625-635 | Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:398-408 — 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) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:539— Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:539-549 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:589-599 — 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1866— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1866-1876 | REDACTED:507-517 — 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) Source/OpenCAGE/Popups/Configuration Editors/LoadMovieEditor.cs:113— Source/OpenCAGE/Popups/Configuration Editors/LoadMovieEditor.cs:113-123 | Source/OpenCAGE/Popups/Configuration Editors/LoadMovieEditor.cs:126-136 — 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) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:493— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:493-503 | Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:73-83 — 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) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:517— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:517-527 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:531-542 — 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) Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:319— Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:319-329 | Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1364-1374 — 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.
Duplicated block (7 lines × 2) Source/OpenCAGE.MCP/Program.cs:916— Source/OpenCAGE.MCP/Program.cs:916-922 | Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:434-440 — 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) Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:35— Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:35-42 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:59-65 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:57` calls `Bind` and `Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:35` 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 (7 lines × 2) Source/OpenCAGE/Popups/GalaxyEditor.cs:74— Source/OpenCAGE/Popups/GalaxyEditor.cs:74-80 | Source/OpenCAGE/Popups/GalaxyEditor.cs:191-197 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/GalaxyEditor.cs:74` 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 (7 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:451— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:451-458 | Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:811-817 — 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 `Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:451` 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) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:809— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:809-815 | Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:820-826 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:809` 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) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:971— Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:971-978 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1251-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 `Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:971` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) Source/OpenCAGE/Popups/ModExporterForm.cs:1304— Source/OpenCAGE/Popups/ModExporterForm.cs:1304-1311 | Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:216-222 — 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) Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:40— Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:40-46 | Source/OpenCAGE/Popups/Configuration Editors/SenseEditor.cs:41-47 — 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.
Duplicated block (7 lines × 2) Source/OpenCAGE.MCP/Program.cs:806— Source/OpenCAGE.MCP/Program.cs:806-812 | Source/OpenCAGE/Scripts/MCP/McpServer.cs:225-231 — 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.
async void method: recaptureAllCubemapsToolStripMenuItem_Click Source/OpenCAGE/CommandsEditor.cs:813— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: TryConnectLiveLink Source/OpenCAGE/CommandsEditor.cs:3256— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: RefreshLiveLinkMenu Source/OpenCAGE/CommandsEditor.cs:3326— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: OnLiveLinkResyncClick Source/OpenCAGE/DockPanels/CompositeDisplay.LiveLink.cs:190— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: CaptureCubemapInGame Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.LiveLink.cs:80— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: TriggerInGame Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.LiveLink.cs:125— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: saveBackup_Click Source/OpenCAGE/Popups/LevelBackupManager.cs:200— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: backupAllNow_Click Source/OpenCAGE/Popups/LevelBackupManager.cs:364— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: Flush Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:1337— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×8
Edited copy of a member (5 corresponding lines) Source/OpenCAGE/Scripts/InstanceTransform.cs:110— Source/OpenCAGE/Scripts/InstanceTransform.cs:110-114 | Source/OpenCAGE/Scripts/InstanceTransform.cs:118-122 — 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) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:727— Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:727-731 | Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:58-67 — 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) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:297— Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:297-303 | Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2006-2010 — 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) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:380— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:380-384 | Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:320-324 — 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) Source/OpenCAGE/Popups/EditSpline.cs:272— Source/OpenCAGE/Popups/EditSpline.cs:272-276 | Source/OpenCAGE/Scripts/Unity Connection/ParameterSync.cs:294-298 — 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) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3681— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3681-3685 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:685-690 — 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) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:943— Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:943-947 | Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2407-2411 — 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) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:750— Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:750-754 | Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2869-2873 — 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.
Duplicated block (11 lines × 2) Source/OpenCAGE/Popups/AddComposite.cs:42— Source/OpenCAGE/Popups/AddComposite.cs:42-52 | Source/OpenCAGE/Popups/RenameComposite.cs:39-49 — 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 (11 lines × 2) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:220— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:220-230 | Source/OpenCAGE/Popups/AddEntity_Function.cs:68-78 — 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 (11 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:249— Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:249-259 | Source/OpenCAGE/Popups/Resource Editors/EditPhysicsSystem.cs:329-339 — 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 `Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:249` 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) Source/OpenCAGE/Scripts/Audio/WwiseAdpcmReader.cs:155— Source/OpenCAGE/Scripts/Audio/WwiseAdpcmReader.cs:155-165 | Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:257-267 — 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 `Source/OpenCAGE/Scripts/Audio/WwiseAdpcmReader.cs:155` 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) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:432— Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:432-442 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:634-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. 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) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:2750— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:2750-2760 | Source/OpenCAGE/Popups/LaunchGame.cs:200-210 — 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) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:131— Source/OpenCAGE/Popups/ImportCompositeArchive.cs:131-141 | Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:922-932 — 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) REDACTED:359— REDACTED:359-369 | Source/OpenCAGE/Scripts/MaterialGenerator.cs:1313-1323 — 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· Edited copy of a member (16 corresponding lines) · ×7
Edited copy of a member (16 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1603— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1603-1619 | Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1223-1238 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:318— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:318-335 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:871-886 — 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) Source/OpenCAGE/Scripts/Audio/WwiseAdpcmReader.cs:154— Source/OpenCAGE/Scripts/Audio/WwiseAdpcmReader.cs:154-169 | Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:256-276 — 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) Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:108— Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:108-126 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:133-148 — 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) Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:827— Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:827-849 | Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1750-1765 — 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) Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:569— Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:569-584 | Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:587-605 — 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:757— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:757-773 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:156-171 — 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 (4 corresponding lines) · ×7
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:775— Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:775-779 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1734-1737 — 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.
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Scripts/ModelIO.cs:2614— Source/OpenCAGE/Scripts/ModelIO.cs:2614-2621 | Source/OpenCAGE/Scripts/AnimationRetarget.cs:893-896 — 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.
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1637— Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1637-1640 | Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:239-242 — 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.
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:643— Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:643-646 | Source/OpenCAGE/Scripts/Audio/WwiseSoundLibrary.cs:74-79 — 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.
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:834— Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:834-837 | Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:442-445 — 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.
Edited copy of a member (4 corresponding lines) Source/OpenCAGE/Scripts/AnimationRetarget.cs:418— Source/OpenCAGE/Scripts/AnimationRetarget.cs:418-421 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4696-4699 — 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.
Edited copy of a member (4 corresponding lines) REDACTED:780— REDACTED:780-783 | Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1347-1350 — 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.
Duplicated block (10 lines × 2) Source/OpenCAGE/Scripts/Unity Connection/Send.cs:229— Source/OpenCAGE/Scripts/Unity Connection/Send.cs:229-238 | Source/OpenCAGE/Scripts/Unity Connection/Send.cs:1133-1142 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Unity Connection/Send.cs:229` 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) Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:23— Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:23-32 | Source/OpenCAGE/Popups/Configuration Editors/SenseEditor.cs:24-33 — 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 (10 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:763— Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:763-772 | Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:805-814 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:763` 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 (10 lines × 2) Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:56— Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:56-65 | Source/OpenCAGE/Popups/Configuration Editors/SenseEditor.cs:57-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 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 (10 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:477— Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:477-486 | Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:487-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) Source/OpenCAGE/Scripts/MaterialApplier.cs:516— Source/OpenCAGE/Scripts/MaterialApplier.cs:516-525 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1089-1098 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:516` 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) Source/OpenCAGE/Scripts/Undo/UndoKeys.cs:42— Source/OpenCAGE/Scripts/Undo/UndoKeys.cs:42-51 | Source/OpenCAGE/Scripts/Unity Connection/ViewerCreateModeKeys.cs:36-45 — 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· Edited copy of a member (22 corresponding lines) · ×6
Edited copy of a member (22 corresponding lines) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1387— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1387-1413 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1448-1469 — 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) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:859— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:859-880 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1616-1648 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:293— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:293-314 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:753-780 — 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) Source/OpenCAGE/Popups/SelectDestinationPin.cs:159— Source/OpenCAGE/Popups/SelectDestinationPin.cs:159-180 | Source/OpenCAGE/Popups/ShowConnectedLinks.cs:274-295 — 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) REDACTED:272— REDACTED:272-294 | REDACTED:483-504 — 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) Source/OpenCAGE/Scripts/Theming/ThemeListView.cs:253— Source/OpenCAGE/Scripts/Theming/ThemeListView.cs:253-274 | Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:67-88 — 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 (12 corresponding lines) · ×6
Edited copy of a member (12 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:449— Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:449-462 | Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:810-821 — 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) Source/OpenCAGE/Scripts/ParameterModificationTracker.cs:101— Source/OpenCAGE/Scripts/ParameterModificationTracker.cs:101-112 | Source/OpenCAGE/Scripts/ParameterModificationTracker.cs:129-140 — 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) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:425— Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:425-436 | Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:438-450 — 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) Source/OpenCAGE/Scripts/Undo/SessionEdits.cs:207— Source/OpenCAGE/Scripts/Undo/SessionEdits.cs:207-220 | Source/OpenCAGE/Scripts/Undo/ParameterEdits.cs:157-168 — 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) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:803— Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:803-817 | Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:1119-1130 — 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) Source/OpenCAGE/Scripts/Theming/ThemeListView.cs:288— Source/OpenCAGE/Scripts/Theming/ThemeListView.cs:288-299 | Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:91-102 — 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×6
Edited copy of a member (6 corresponding lines) Source/OpenCAGE/Scripts/InstanceTransform.cs:58— Source/OpenCAGE/Scripts/InstanceTransform.cs:58-66 | Source/OpenCAGE/Scripts/InstanceTransform.cs:101-106 — 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) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2703— Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2703-2708 | Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1067-1072 — 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) Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:61— Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:61-109 | Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:301-306 — 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) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1136— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1136-1143 | Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1784-1789 — 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) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:190— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:190-195 | Source/OpenCAGE/Popups/SelectComposite.cs:131-136 — 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) Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:275— Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:275-280 | Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:1141-1146 — 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.
Low cohesion: CommandsEditor (LCOM4 51) Source/OpenCAGE/CommandsEditor.cs:42— CommandsEditor's methods fall into 51 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 51 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ModelEditorControlsWPF (LCOM4 8) Source/OpenCAGE/Popups/Resource Editors/ModelEditorControlsWPF.xaml.cs:11— ModelEditorControlsWPF's methods fall into 8 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 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Flowgraph (LCOM4 5) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:33— Flowgraph's methods fall into 5 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 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Scene (LCOM4 5) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:222— Scene's methods fall into 5 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 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: EntityBrowser (LCOM4 4) Source/OpenCAGE/DockPanels/EntityBrowser.cs:12— EntityBrowser's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: InputsEditor (LCOM4 4) REDACTED:24— InputsEditor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AX2 · Stateful singletons· Process-global static state · ×5
Process-global static state: Data Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:27— `Data` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (dict; e.g. `dict` at line 39). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: EditBlendSets Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:25— `EditBlendSets` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_setsBefore, _usersBefore; e.g. `_setsBefore` at line 651). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: PackageDropTarget Source/OpenCAGE/Scripts/PackageDropTarget.cs:11— `PackageDropTarget` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_attached, _watched; e.g. `_attached` at line 21). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: PackageFiles Source/OpenCAGE/Scripts/PackageFiles.cs:16— `PackageFiles` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (PendingOpen, _activeImport, _stashWatcher, _drainTimer; e.g. `PendingOpen` at line 85). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: CompositeIndexCache Source/OpenCAGE/Scripts/CompositeImporter.cs:105— `CompositeIndexCache` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cache; e.g. `_cache` at line 138). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×5
Edited copy of a member (14 corresponding lines) Source/OpenCAGE/Scripts/AnimationImport.cs:694— Source/OpenCAGE/Scripts/AnimationImport.cs:694-707 | Source/OpenCAGE/Scripts/AnimationImport.cs:710-723 — 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:153— REDACTED:153-166 | REDACTED:187-202 — 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) Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:318— Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:318-331 | Source/OpenCAGE/Popups/Resource Editors/EditTexture.cs:334-347 — 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) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1801— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1801-1816 | Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1832-1845 — 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) Source/OpenCAGE/Scripts/Audio/WwiseFilePackage.cs:40— Source/OpenCAGE/Scripts/Audio/WwiseFilePackage.cs:40-53 | Source/OpenCAGE/Popups/ModExporterForm.cs:667-680 — 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) · ×5
Edited copy of a member (13 corresponding lines) Source/OpenCAGE/Scripts/MaterialApplier.cs:145— Source/OpenCAGE/Scripts/MaterialApplier.cs:145-157 | Source/OpenCAGE/Scripts/MaterialApplier.cs:160-172 — 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) Source/OpenCAGE/Popups/Function Editors/TriggerSequenceEditor.cs:388— Source/OpenCAGE/Popups/Function Editors/TriggerSequenceEditor.cs:388-400 | Source/OpenCAGE/Popups/Function Editors/TriggerSequenceEditor.cs:403-415 — 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) Source/OpenCAGE/Popups/Configuration Editors/Popups/MovieSelectorPopup.cs:20— Source/OpenCAGE/Popups/Configuration Editors/Popups/MovieSelectorPopup.cs:20-32 | Source/OpenCAGE/Popups/Configuration Editors/Popups/PermaSoundbankPopup.cs:20-32 — 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) Source/OpenCAGE/Popups/AddOrEditResource.cs:34— Source/OpenCAGE/Popups/AddOrEditResource.cs:34-46 | Source/OpenCAGE/Popups/AddOrEditResource.cs:49-62 — 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) Source/OpenCAGE/Scripts/Unity Connection/ViewerContextMenu.cs:175— Source/OpenCAGE/Scripts/Unity Connection/ViewerContextMenu.cs:175-189 | Source/OpenCAGE/Popups/Base/BaseWindow.cs:228-240 — 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.
Duplicated block (16 lines × 2) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddKeyframeAtTime.cs:40— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddKeyframeAtTime.cs:40-55 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddStringEvent.cs:36-51 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddKeyframeAtTime.cs:38` calls `ToString` and `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddStringEvent.cs:34` 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 (16 lines × 2) Source/OpenCAGE/Scripts/LocalDebug.cs:163— Source/OpenCAGE/Scripts/LocalDebug.cs:163-178 | Source/OpenCAGE/Scripts/LocalDebug.cs:199-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.
Duplicated block (16 lines × 2) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:274— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:274-289 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:354-369 — 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 `Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:650— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:650-665 | Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:709-724 — 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 (16 lines × 2) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:255— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:255-270 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:335-350 — 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.
Duplicated block (12 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:219— Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:219-230 | Source/OpenCAGE/Popups/Resource Editors/EditPhysicsSystem.cs:298-309 — 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 `Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1920— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1920-1931 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1944-1955 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1920` 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 (12 lines × 2) Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:71— Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:71-82 | Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs:73-84 — before extracting anything, compare `Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs` and `Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:71` 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 (12 lines × 2) Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:57— Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:57-68 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisSetups.cs:139-150 — 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 `Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:57` 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) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2692— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2692-2703 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:404-415 — 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 `Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2692` 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.
Condition was already decided — an earlier guard makes this test constant Source/OpenCAGE/Scripts/EditorUtils.cs:104— Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 93 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
Condition was already decided — an earlier guard makes this test constant Source/OpenCAGE/Scripts/EditorUtils.cs:897— Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 892 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
Condition was already decided — an earlier guard makes this test constant Source/OpenCAGE/Scripts/EditorUtils.cs:903— Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 892 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
Condition was already decided — an earlier guard makes this test constant Source/OpenCAGE/Scripts/EditorUtils.cs:903— Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 897 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
Condition was already decided — an earlier guard makes this test constant Source/OpenCAGE/Scripts/EditorUtils.cs:949— Control only reaches here when `ct.IsCancellationRequested` is false, because the guard on line 943 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×5
Recursive walk over a caller-supplied document has no depth cap REDACTED:641— `Element` is public and takes the `XmlElement` from its caller, and it calls itself at line 641 with a child of the node it was given — and nowhere in `Element` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Element` can intervene. Thread a depth argument through `Element` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap Source/OpenCAGE/Scripts/MCP/McpScript.cs:366— `PathSteps` is public and takes the `JToken` from its caller, and it calls itself at line 366 with a child of the node it was given (and at line 367) — and nowhere in `PathSteps` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `PathSteps` can intervene. Thread a depth argument through `PathSteps` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap Source/OpenCAGE/Scripts/MCP/McpTool.cs:510— `ForClients` is public, takes a document from its caller (line 470) and hands it to `StripDeprecated`, which calls itself at line 510 with a child of the node it was given (and at line 515) — and nowhere in `StripDeprecated` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `ForClients` can intervene. Thread a depth argument through `StripDeprecated` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap Source/OpenCAGE/Scripts/MCP/McpTool.cs:594— `Canonical` is public, takes a document from its caller (line 583) and hands it to `Sorted`, which calls itself at line 594 with a child of the node it was given — and nowhere in `Sorted` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Canonical` can intervene. Thread a depth argument through `Sorted` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap Source/OpenCAGE/Scripts/MCP/McpTool.cs:710— `Check` is public, takes a document from its caller (line 648) and hands it to `Walk`, which calls itself at line 710 with a child of the node it was given (and at line 712, line 725) — and nowhere in `Walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `Check` can intervene. Thread a depth argument through `Walk` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
DeadPreprocessorBranch Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:114— #if DEBUG && DO_DUMP — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:453— #if DISABLE_FLOWGRAPHS — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch Source/OpenCAGE/Scripts/LocalDebug.cs:631— #if NO — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch Source/OpenCAGE/Scripts/LocalDebug.cs:800— #if FG_TEST — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpScript.cs:670— Source/OpenCAGE/Scripts/MCP/McpScript.cs:670-688 | Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:399-417 — 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:189— REDACTED:189-208 | REDACTED:211-229 — 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) Source/OpenCAGE/Scripts/CompositePreviewManager.cs:315— Source/OpenCAGE/Scripts/CompositePreviewManager.cs:315-335 | Source/OpenCAGE/Scripts/CompositePreviewManager.cs:343-361 — 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) Source/OpenCAGE/Scripts/Modding/ModServices.cs:119— Source/OpenCAGE/Scripts/Modding/ModServices.cs:119-137 | Source/OpenCAGE/Scripts/Modding/ModServices.cs:175-194 — 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 (20 corresponding lines) · ×4
Edited copy of a member (20 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpTool.cs:775— Source/OpenCAGE/Scripts/MCP/McpTool.cs:775-796 | Source/OpenCAGE/Scripts/MCP/McpRegion.cs:514-533 — 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) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:105— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:105-124 | Source/OpenCAGE/DockPanels/CompositeBrowser.cs:134-154 — 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) Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:536— Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:536-559 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:586-605 — 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) Source/OpenCAGE/Scripts/BuildFingerprint.cs:48— Source/OpenCAGE/Scripts/BuildFingerprint.cs:48-68 | Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1542-1561 — 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.
Duplicated block (14 lines × 2) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:106— Source/OpenCAGE/DockPanels/CompositeBrowser.cs:106-119 | Source/OpenCAGE/DockPanels/CompositeBrowser.cs:135-148 — both copies are in the same file, so extract the 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 (14 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:242— Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:242-255 | Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:948-961 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:242` 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) Source/OpenCAGE/Scripts/MaterialApplier.cs:630— Source/OpenCAGE/Scripts/MaterialApplier.cs:630-643 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1258-1271 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:630` 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1222— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1222-1235 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:316-329 — 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.
Duplicated block (13 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:196— Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:196-208 | Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:130-142 — 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 (13 lines × 2) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:86— Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:86-98 | Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:181-193 — both copies are in the same file, so extract the 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) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:1208— Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:1208-1220 | Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:1323-1335 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:1208` 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 (13 lines × 2) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:515— Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:515-527 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:735-747 — 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.
Duplicated block (6 lines × 3) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:137— Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:137-142 | Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:158-163 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:229-234 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) Source/OpenCAGE/Scripts/Audio/OggWriter.cs:92— Source/OpenCAGE/Scripts/Audio/OggWriter.cs:92-97 | Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:812-817 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:303-308 — 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.
Duplicated block (6 lines × 3) Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:345— Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:345-350 | Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:378-383 | Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:415-420 — 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 `Source/OpenCAGE/Scripts/EnumStringListViewItems.cs: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:737— Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:737-742 | Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:403-408 | Source/OpenCAGE/Scripts/MCP/McpScript.cs:674-679 — 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 `Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:737` 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.
Weak hash algorithm Source/OpenCAGE/Scripts/AlienLevel.cs:469— MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses.
Weak hash algorithm Source/OpenCAGE/Scripts/AlienLevel.cs:921— MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses.
Weak hash algorithm Source/OpenCAGE/Scripts/AnalyticsManager.cs:17— MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses.
Weak hash algorithm Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:1433— MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses.
Sync-over-async (deadlock risk) through `.Wait(…)` Source/OpenCAGE/Scripts/PackageHandover.cs:256— `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
Sync-over-async (deadlock risk) through `.Wait(…)` Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5085— `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
Sync-over-async (deadlock risk) through `.Wait(…)` Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:598— `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
Sync-over-async (deadlock risk) through `.Wait(…)` Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1760— `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
Sync-over-async (deadlock risk) through `.Result` Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:68— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
Sync-over-async (deadlock risk) through `.Result` Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:134— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
Sync-over-async (deadlock risk) through `.Result` Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1760— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
Sync-over-async (deadlock risk) through `.Result` Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1762— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
HackComment Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:438— //TEMPORARY HACK FIX FOR DE-SELECTION RACE CONDITION BUG — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment Source/OpenCAGE/Popups/SelectDestinationPin.cs:53— //Hack: create a new node based off the current node's entity and add all pins to it, so that we can know all options to list — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:464— //HACK: We handle composite material mappings as a special type! — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
Change coupling: CommandsEditor.cs ↔ SettingsDefaults.cs Source/OpenCAGE/CommandsEditor.cs:1— `Source/OpenCAGE/CommandsEditor.cs` and `Source/OpenCAGE/Scripts/SettingsDefaults.cs` change together 73% of the time (19 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `7dba2ce0` add radiosity skip option, import previews; `110e57b9` cubemap capturing; `0e5f562c` various render improvements in the viewport — run `git show` on any of them.
Change coupling: McpLevelTools.cs ↔ SettingsDefaults.cs Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1— `Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs` and `Source/OpenCAGE/Scripts/SettingsDefaults.cs` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `7dba2ce0` add radiosity skip option, import previews; `110e57b9` cubemap capturing; `1cc4c079` cinematic tools gates script helpers — run `git show` on any of them.
Change coupling: CompositeDisplay.cs ↔ ViewerInboundDispatcher.cs Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1— `Source/OpenCAGE/DockPanels/CompositeDisplay.cs` and `Source/OpenCAGE/Scripts/Unity Connection/ViewerInboundDispatcher.cs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `8ecd3f06` initial implementation of livelink; `faa2d59b` fixing a variety of hangs and edge cases; `4065fcbf` add new node colouring, fix some ux issues — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:433— Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:433-463 | Source/OpenCAGE.MCP/Program.cs:915-945 — 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) Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:201— Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:201-231 | Source/OpenCAGE/Scripts/PhysicsSystemImporter.cs:128-159 — 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) Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:212— Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:212-242 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:246-278 — 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 copies of one member (3 members, 17+ corresponding lines) · ×3
Edited copies of one member (3 members, 17+ corresponding lines) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5659— Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5659-5677 | Source/OpenCAGE/Scripts/MCP/McpRegion.cs:571-587 | Source/OpenCAGE/Scripts/MCP/McpTool.cs:808-828 — 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) Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:20— Source/OpenCAGE/Popups/Configuration Editors/LocomotionEditor.cs:20-36 | Source/OpenCAGE/Popups/Configuration Editors/SenseEditor.cs:21-37 | Source/OpenCAGE/Popups/Configuration Editors/ViewconeEditor.cs:24-52 — 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) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:560— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:560-576 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:624-640 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:591-607 — 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 copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) Source/OpenCAGE/Scripts/Unity Connection/Send.cs:642— Source/OpenCAGE/Scripts/Unity Connection/Send.cs:642-667 | Source/OpenCAGE/Scripts/Unity Connection/Send.cs:840-862 — 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) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:323— Source/OpenCAGE/Scripts/Audio/SoundImport.cs:323-345 | Source/OpenCAGE/Scripts/Audio/SoundImport.cs:461-483 — 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) Source/OpenCAGE/Scripts/PackageHandover.cs:162— Source/OpenCAGE/Scripts/PackageHandover.cs:162-184 | Source/OpenCAGE/Scripts/MCP/McpServer.cs:88-114 — 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· Edited copy of a member (18 corresponding lines) · ×3
Edited copy of a member (18 corresponding lines) Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:87— Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:87-107 | Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:115-132 — 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) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:516— Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:516-533 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:536-556 — 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) Source/OpenCAGE/Scripts/PrimaryInstanceLock.cs:24— Source/OpenCAGE/Scripts/PrimaryInstanceLock.cs:24-57 | Source/OpenCAGE.MCP/Program.cs:618-635 — 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 (1 corresponding lines) · ×3
Edited copy of a member (1 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1585— Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1585-1585 | Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1375-1375 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:941— Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:941-941 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:185-185 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:285— Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:285-285 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1089-1089 — These two members are one piece of code written twice and then edited apart: 1 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.
Duplicated block (20 lines × 2) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:369— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:369-388 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:945-964 — 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 `Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:369` 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 (20 lines × 2) Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:652— Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:652-671 | Source/OpenCAGE/Scripts/EditorUtils.cs:455-474 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `str` to `this string` in one and `string` 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 (20 lines × 2) Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:540— Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:540-559 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:564-583 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:540` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:529— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:529-536 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:542-549 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:555-562 — 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. 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 (8 lines × 3) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:64— Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:64-71 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:432-439 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:634-641 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:294— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:294-301 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:302-309 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:310-317 — 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.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×3
NuGet dependencies are not locked Source/OpenCAGE.MCP/OpenCAGE.MCP.csproj:47— Source/OpenCAGE.MCP/OpenCAGE.MCP.csproj declares NuGet packages that no committed packages.lock.json resolves and no central package management pins — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
NuGet dependencies are not locked Source/OpenCAGE/packages.config:3— Source/OpenCAGE/packages.config declares NuGet packages that no committed packages.lock.json resolves and no central package management pins — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
NuGet dependencies are not locked Source/Packager/packages.config:3— Source/Packager/packages.config declares NuGet packages that no committed packages.lock.json resolves and no central package management pins — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Collection crosses a callback boundary unsynchronised Source/OpenCAGE/Popups/UserControls/GameDirectory.cs:114— `ChildInstanceManager._processes` is a `Dictionary<…>` that a `Process.Exited +=` callback writes (`Remove` on line 114) and `Start` reads (line 104). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `Start` runs on whichever thread calls it. `Dictionary<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_processes`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context.
Collection crosses a callback boundary unsynchronised Source/OpenCAGE/Scripts/SettingsManager.cs:563— `SettingsManager._dirtyKeys` is a `HashSet<…>` that a `new Timer(…)` callback writes (`Remove` on line 563) and `MarkRemoved` reads (line 276). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `MarkRemoved` runs on whichever thread calls it. `HashSet<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_dirtyKeys`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context.
Collection crosses a callback boundary unsynchronised Source/OpenCAGE/Scripts/SettingsManager.cs:566— `SettingsManager._removedKeys` is a `HashSet<…>` that a `new Timer(…)` callback writes (`Remove` on line 566) and `MarkRemoved` reads (line 275). The runtime runs that callback on a thread the rest of the type does not own — a pool or I/O thread for a watcher, timer or process event, the completing thread for a continuation, the cancelling thread for a token registration, the pool for a `Progress<T>` made without a UI context — while `MarkRemoved` runs on whichever thread calls it. `HashSet<…>` allows many readers or one writer, never both: a read that meets the write sees a torn resize, an enumeration throws `InvalidOperationException`, and two writes lose or duplicate entries. Take one `lock` over the write and every read of `_removedKeys`, use a `System.Collections.Concurrent` collection, or marshal the callback onto the reader's synchronisation context.
Swallowed exception (caught, then discarded) Source/OpenCAGE/CommandsEditor.cs:1332— `catch (ObjectDisposedException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Swallowed exception (caught, then discarded) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:309— `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Swallowed exception (caught, then discarded) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:275— `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
EntityInspector.PopulateUI (cyclomatic 17) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:319— EntityInspector.PopulateUI 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.
EntityInspector.PopulateUI (cyclomatic 17) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:400— EntityInspector.PopulateUI has cyclomatic complexity 17 (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.
Repeated repair: Source/OpenCAGE/Popups/SelectHierarchy.cs Source/OpenCAGE/Popups/SelectHierarchy.cs:63— Source/OpenCAGE/Popups/SelectHierarchy.cs changed 6 times in last 90 days and 4 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 SelectHierarchy.TryRestoreNavigation at line 63), 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: “zone highlights, drag select, galaxy render, misc mat fixes, misc others”; “fix ctrl mmb bug”; “fixes for some dodgy resolves”; “enable dirty tracker, fix some ownership”. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/SelectHierarchy.cs`: 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: Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:60— Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs changed 5 times in last 90 days and 3 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 GUI_ModelViewer.ShowPreviewMesh 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: “various mcp improvements and fixes from soak test”; “fix some model editor renderer leaks”; “fix scaling bug in model editor preview”. 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-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 17:39:20 +00:00' --until='2026-10-29 17:39:20 +00:00' --full-history --no-merges -- Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs`: 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.
FunctionTooLong: dashboard_app.App Source/WebAPI/dashboard_app.js:352— FunctionTooLong — App runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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: dashboard_app.ScatterChart Source/WebAPI/dashboard_app.js:92— FunctionTooLong — ScatterChart runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× 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 (48 corresponding lines) · ×2
Edited copy of a member (48 corresponding lines) Source/OpenCAGE/Popups/RenameComposite.cs:33— Source/OpenCAGE/Popups/RenameComposite.cs:33-94 | Source/OpenCAGE/Popups/AddComposite.cs:37-84 — 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.
Edited copy of a member (48 corresponding lines) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:201— Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:201-259 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:321-368 — 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 copy of a member (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:321— Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:321-361 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:415-442 — 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) Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:61— Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:61-90 | Source/OpenCAGE/Popups/Resource Editors/EditPhysicsSystem.cs:67-94 — 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 (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:217— Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:217-241 | Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:246-273 — 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) Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:613— Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:613-640 | Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:1135-1159 — 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· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) Source/OpenCAGE/Scripts/MaterialApplier.cs:105— Source/OpenCAGE/Scripts/MaterialApplier.cs:105-123 | Source/OpenCAGE/Scripts/MaterialApplier.cs:126-142 — 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) Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:110— Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:110-132 | Source/OpenCAGE/Scripts/Theming/ThemePainters.cs:463-479 — 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 (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:208— Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:208-237 | Source/OpenCAGE/Popups/Resource Editors/EditPhysicsSystem.cs:287-316 — 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.
Edited copy of a member (30 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:215— Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:215-244 | Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:247-279 — 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2584— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2584-2619 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:417-445 — 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.
Edited copy of a member (29 corresponding lines) Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:59— Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:59-88 | Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:557-585 — 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 (3 members, 21+ corresponding lines) · ×2
Edited copies of one member (3 members, 21+ corresponding lines) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:273— Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:273-293 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:329-349 | Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:353-373 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 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, 21+ corresponding lines) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:40— Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:40-60 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:385-405 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:408-428 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 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) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1101— Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1101-1108 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2058-2064 | Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:95-103 — 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) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationSets.cs:129— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationSets.cs:129-135 | REDACTED:309-315 | Source/OpenCAGE/Scripts/Modding/PakParts.cs:139-145 — 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, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) Source/OpenCAGE/CommandsEditor.Undo.cs:94— Source/OpenCAGE/CommandsEditor.Undo.cs:94-100 | Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:302-308 | Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1425-1431 | Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2123-2129 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:103— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:103-109 | Source/OpenCAGE/Popups/SelectComposite.cs:96-102 | Source/OpenCAGE/Popups/SelectDestinationPin.cs:183-189 | Source/OpenCAGE/Popups/ShowConnectedLinks.cs:298-304 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
Duplicated block (32 lines × 2) Source/OpenCAGE/CommandsEditor.cs:3771— Source/OpenCAGE/CommandsEditor.cs:3771-3802 | Source/OpenCAGE/CommandsEditor.cs:3915-3946 — both copies are in the same file, so extract the 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 (32 lines × 2) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:806— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:806-837 | Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2086-2117 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:806` 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) Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:135— Source/OpenCAGE/Scripts/Theming/ThemeListViewHeader.cs:135-153 | Source/OpenCAGE/Scripts/Theming/ThemePainters.cs:482-498 — 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 (17 lines × 2) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:401— Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:401-417 | Source/OpenCAGE/Scripts/MCP/McpScript.cs:672-688 — 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 `Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:401` 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–12 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1156— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1156-1166 | Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1056-1067 — 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 `Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1156` 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 (11–12 lines × 2) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:153— Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:153-163 | Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:223-234 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) Source/OpenCAGE/Scripts/MaterialGenerator.cs:682— Source/OpenCAGE/Scripts/MaterialGenerator.cs:682-689 | Source/OpenCAGE/Scripts/MaterialGenerator.cs:1202-1211 — both copies are in the same file, so extract the 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–10 lines × 2) Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:46— Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:46-55 | Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:102-109 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Popups/Resource Editors/GUI_ModelViewer.xaml.cs:102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3261— Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3261-3269 | Source/OpenCAGE/Popups/AddEntity_Variable.cs:108-115 — 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–9 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1403— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1403-1410 | Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs: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.
Duplicated block (5 lines × 3) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174— Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174-2178 | Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2230-2234 | Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2279-2283 — 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 `Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174` 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 × 3) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1845— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1845-1849 | Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2944-2948 | REDACTED:479-483 — 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 `Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1845` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1844` calls `revert` and `Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2943` 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.
Unfinished branch — throws a "not implemented" exception Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:219— The branch `if (McpScript.IsFolder(composite))` throws `McpError` while the member's other paths do the work — the branch was never written, so every input that reaches it fails at run time. Implement the branch, or reject the input where it enters with an exception that says it is not supported.
Unfinished branch — throws a "not implemented" exception Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:541— The branch `if (McpScriptTools.IsFolderPlaceholder(instanced))` throws `McpError` while the member's other paths do the work — the branch was never written, so every input that reaches it fails at run time. Implement the branch, or reject the input where it enters with an exception that says it is not supported.
Blocking `CommandsEditor.SaveLevel` inside an `async` method Source/OpenCAGE/Popups/LevelBackupManager.cs:219— `CommandsEditor.SaveLevel` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `CommandsEditor.SaveLevel` inside an `async` method Source/OpenCAGE/Popups/LevelBackupManager.cs:372— `CommandsEditor.SaveLevel` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
McpBrowseTools.FindEntities (cyclomatic 203) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:779— McpBrowseTools.FindEntities has cyclomatic complexity 203 (threshold 15). Of this number, 80 points are the body's own statements and 123 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.
McpImportTools.ImportModel (cyclomatic 118) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:272— McpImportTools.ImportModel has cyclomatic complexity 118 (threshold 15). Of this number, 36 points are the body's own statements and 82 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.
Geometry.Geometry.ctor (cyclomatic 108) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:138— Geometry.Geometry.ctor has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnumStringListViewItems.AddItems (cyclomatic 106) Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:189— EnumStringListViewItems.AddItems has cyclomatic complexity 106 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpUsageTools.TraceLinks (cyclomatic 106) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:852— McpUsageTools.TraceLinks has cyclomatic complexity 106 (threshold 15). Most of this is not in the body itself: 5 of the 106 points are its own statements and the rest belongs to one function literal inside it that branches (line 864). 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.
McpLightTools.SetLights (cyclomatic 104) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:537— McpLightTools.SetLights has cyclomatic complexity 104 (threshold 15). Of this number, 43 points are the body's own statements and 61 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.PlanLinks (cyclomatic 103) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:935— McpZoneTools.PlanLinks has cyclomatic complexity 103 (threshold 15). Of this number, 100 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.
McpLevelTools.RuntimeUtils (cyclomatic 97) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:970— McpLevelTools.RuntimeUtils has cyclomatic complexity 97 (threshold 15). Of this number, 95 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.
ModInstaller.ApplyConfigurationLocked (cyclomatic 96) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1675— ModInstaller.ApplyConfigurationLocked has cyclomatic complexity 96 (threshold 15). Of this number, 91 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpCageAnimationTools.ApplySet (cyclomatic 95) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2338— McpCageAnimationTools.ApplySet has cyclomatic complexity 95 (threshold 15). Of this number, 93 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpEditingTools.CopySet (cyclomatic 94) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:324— McpEditingTools.CopySet has cyclomatic complexity 94 (threshold 15). Of this number, 93 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.
McpZoneTools.JoinZones (cyclomatic 93) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2096— McpZoneTools.JoinZones has cyclomatic complexity 93 (threshold 15). Of this number, 89 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.
McpZoneTools.CheckZones (cyclomatic 93) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2396— McpZoneTools.CheckZones has cyclomatic complexity 93 (threshold 15). Of this number, 22 points are the body's own statements and 71 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.
McpViewportTools.SetView (cyclomatic 90) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:788— McpViewportTools.SetView has cyclomatic complexity 90 (threshold 15). Most of this is not in the body itself: 1 of the 90 points is its own statement and the rest belongs to one function literal inside it that branches (line 790). 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.
PakParts.AnimationParts (cyclomatic 89) Source/OpenCAGE/Scripts/Modding/PakParts.cs:186— PakParts.AnimationParts has cyclomatic complexity 89 (threshold 15). Of this number, 80 points are the body's own statements and 9 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpLevelTools.LaunchOptions (cyclomatic 88) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:380— McpLevelTools.LaunchOptions has cyclomatic complexity 88 (threshold 15). Of this number, 82 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpLevelTools.ExportMod (cyclomatic 88) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:2213— McpLevelTools.ExportMod has cyclomatic complexity 88 (threshold 15). Of this number, 79 points are the body's own statements and 9 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.
McpEditorTools.LaunchGame (cyclomatic 83) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1545— McpEditorTools.LaunchGame has cyclomatic complexity 83 (threshold 15). Of this number, 74 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpCageAnimationTools.Retime (cyclomatic 81) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1779— McpCageAnimationTools.Retime has cyclomatic complexity 81 (threshold 15). Of this number, 73 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGameDataTools.EditElements (cyclomatic 75) REDACTED:2728— McpGameDataTools.EditElements has cyclomatic complexity 75 (threshold 15). Of this number, 74 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.
McpSpatialTools.Loop (cyclomatic 75) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1100— McpSpatialTools.Loop has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpAnimationAssetTools.ImportAnimation (cyclomatic 73) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1591— McpAnimationAssetTools.ImportAnimation has cyclomatic complexity 73 (threshold 15). Of this number, 43 points are the body's own statements and 30 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.
McpCharacterTools.SpawnNpcTool (cyclomatic 73) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1111— McpCharacterTools.SpawnNpcTool has cyclomatic complexity 73 (threshold 15). Of this number, 28 points are the body's own statements and 45 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.
McpAssetTools.FindAssetUsers (cyclomatic 71) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1880— McpAssetTools.FindAssetUsers has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 7 of the 71 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1887, 2016, 2012, …). 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.
NodeUtils.GetAllPinPositions (cyclomatic 70) Source/OpenCAGE/Scripts/NodeUtils.cs:146— NodeUtils.GetAllPinPositions has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCharacterTools.PlayCharacterAnimation (cyclomatic 70) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1764— McpCharacterTools.PlayCharacterAnimation has cyclomatic complexity 70 (threshold 15). Of this number, 19 points are the body's own statements and 51 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.
McpZoneTools.PlanAutoZones (cyclomatic 69) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:1127— McpZoneTools.PlanAutoZones has cyclomatic complexity 69 (threshold 15). Of this number, 66 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.
McpZoneTools.MergeZones (cyclomatic 68) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1355— McpZoneTools.MergeZones has cyclomatic complexity 68 (threshold 15). Of this number, 58 points are the body's own statements and 10 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.
EntityInspector.Reload (cyclomatic 67) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:531— EntityInspector.Reload has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelIO.BuildScene (cyclomatic 66) Source/OpenCAGE/Scripts/ModelIO.cs:280— ModelIO.BuildScene has cyclomatic complexity 66 (threshold 15). Of this number, 64 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.
McpEditorTools.Tools (cyclomatic 66) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:29— McpEditorTools.Tools has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 1 of the 66 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 307, 370, 58, …). 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.
McpSpatialTools.GetBounds (cyclomatic 66) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:504— McpSpatialTools.GetBounds has cyclomatic complexity 66 (threshold 15). Of this number, 64 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.
McpLightTools.AddLight (cyclomatic 66) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:854— McpLightTools.AddLight has cyclomatic complexity 66 (threshold 15). Of this number, 44 points are the body's own statements and 22 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpAnimationAssetTools.ReplaceSound (cyclomatic 65) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5364— McpAnimationAssetTools.ReplaceSound has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCageAnimationTools.Check (cyclomatic 65) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1303— McpCageAnimationTools.Check has cyclomatic complexity 65 (threshold 15). Of this number, 52 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Geometry.AbsorbTiny (cyclomatic 65) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:924— Geometry.AbsorbTiny has cyclomatic complexity 65 (threshold 15). Of this number, 57 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCameraTools.ReadPath (cyclomatic 65) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:140— McpCameraTools.ReadPath has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.BuildScene (cyclomatic 62) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:322— McpZoneTools.BuildScene has cyclomatic complexity 62 (threshold 15). Of this number, 38 points are the body's own statements and 24 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.
McpMaterialTools.EditMaterialTool (cyclomatic 61) REDACTED:521— McpMaterialTools.EditMaterialTool has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 13 of the 61 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 534, 675, 684, …). 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.
McpScriptEdit.RenamePin (cyclomatic 61) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:821— McpScriptEdit.RenamePin has cyclomatic complexity 61 (threshold 15). Of this number, 54 points are the body's own statements and 7 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.
AttributesEditor.Save (cyclomatic 60) Source/OpenCAGE/Popups/Configuration Editors/AttributesEditor.cs:315— AttributesEditor.Save has cyclomatic complexity 60 (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.
NodeUtils.AddAllPins (cyclomatic 60) Source/OpenCAGE/Scripts/NodeUtils.cs:708— NodeUtils.AddAllPins has cyclomatic complexity 60 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpResourceTools.SetCharacterAppearance (cyclomatic 60) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2305— McpResourceTools.SetCharacterAppearance has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 1 of the 60 points is its own statement and the rest belongs to one function literal inside it that branches (line 2307). 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.
McpSpatialTools.DropToFloor (cyclomatic 60) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1549— McpSpatialTools.DropToFloor has cyclomatic complexity 60 (threshold 15). Of this number, 25 points are the body's own statements and 35 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.
McpCharacterTools.CreateNpcRoute (cyclomatic 60) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1582— McpCharacterTools.CreateNpcRoute has cyclomatic complexity 60 (threshold 15). Of this number, 38 points are the body's own statements and 22 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.
App (cyclomatic 60) Source/WebAPI/dashboard_app.js:352— App has cyclomatic complexity 60 (threshold 15). Of this number, 31 points are the body's own statements and 29 belong to 69 function items 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.
McpLevelTools.Mods (cyclomatic 59) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:2032— McpLevelTools.Mods has cyclomatic complexity 59 (threshold 15). Of this number, 55 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.
McpNavTools.QueryNavmesh (cyclomatic 58) Source/OpenCAGE/Scripts/MCP/McpNavTools.cs:105— McpNavTools.QueryNavmesh has cyclomatic complexity 58 (threshold 15). Of this number, 55 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.
dashboard_app.ScatterChart (cyclomatic 58) Source/WebAPI/dashboard_app.js:92— dashboard_app.ScatterChart has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 4 of the 58 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 96, 164, 152, …). 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.
LoadedGameFiles.BeforeChange (cyclomatic 55) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:56— LoadedGameFiles.BeforeChange has cyclomatic complexity 55 (threshold 15). Of this number, 50 points are the body's own statements and 5 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.
McpAnimationAssetTools.ClipSheet (cyclomatic 55) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2187— McpAnimationAssetTools.ClipSheet has cyclomatic complexity 55 (threshold 15). Of this number, 52 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCageAnimationTools.SetAnimatedModel (cyclomatic 55) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3945— McpCageAnimationTools.SetAnimatedModel has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 1 of the 55 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 3947, 3969, 3977, …). 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.
McpSpatialTools.Raycast (cyclomatic 55) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:690— McpSpatialTools.Raycast has cyclomatic complexity 55 (threshold 15). Of this number, 54 points are the body's own statements and 1 belongs 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.
McpScriptTools.Make (cyclomatic 54) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:929— McpScriptTools.Make has cyclomatic complexity 54 (threshold 15). Of this number, 53 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.
Flowgraph.ContextMenu_Opening (cyclomatic 53) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1178— Flowgraph.ContextMenu_Opening has cyclomatic complexity 53 (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.
McpAnimationAssetTools.EditBlendSet (cyclomatic 53) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2910— McpAnimationAssetTools.EditBlendSet has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 4 of the 53 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2927, 3059). 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.
McpFlowgraphTools.Read (cyclomatic 53) Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:57— McpFlowgraphTools.Read has cyclomatic complexity 53 (threshold 15). Of this number, 49 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.
McpAssetTools.PlaceModel (cyclomatic 52) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1224— McpAssetTools.PlaceModel has cyclomatic complexity 52 (threshold 15). Of this number, 25 points are the body's own statements and 27 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.
McpAnimationAssetTools.EditAnimationEvents (cyclomatic 52) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1952— McpAnimationAssetTools.EditAnimationEvents has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 12 of the 52 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2018, 1990, 2094, …). 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.
McpEditingTools.CopyEntities (cyclomatic 52) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:207— McpEditingTools.CopyEntities has cyclomatic complexity 52 (threshold 15). Of this number, 47 points are the body's own statements and 5 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.
McpGameDataTools.SetTextDatabases (cyclomatic 52) REDACTED:2479— McpGameDataTools.SetTextDatabases 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.
McpCageAnimationTools.Preview (cyclomatic 51) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3560— McpCageAnimationTools.Preview has cyclomatic complexity 51 (threshold 15). Of this number, 30 points are the body's own statements and 21 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.
McpZoneTools.CreateZoneLink (cyclomatic 51) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2269— McpZoneTools.CreateZoneLink has cyclomatic complexity 51 (threshold 15). Of this number, 27 points are the body's own statements and 24 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnimTreeCanvas.LinksOf (cyclomatic 50) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:248— AnimTreeCanvas.LinksOf has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpAnimationAssetTools.ExportAnimations (cyclomatic 50) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1383— McpAnimationAssetTools.ExportAnimations has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 13 of the 50 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1426, 1463, 1387, …). 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.
McpScriptTools.StepSetParameters (cyclomatic 50) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1385— McpScriptTools.StepSetParameters has cyclomatic complexity 50 (threshold 15). Of this number, 48 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.
McpScriptTools.StepTriggerSequence (cyclomatic 50) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1880— McpScriptTools.StepTriggerSequence has cyclomatic complexity 50 (threshold 15). Of this number, 48 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpAnimationAssetTools.ApplyLayoutAction (cyclomatic 49) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4357— McpAnimationAssetTools.ApplyLayoutAction has cyclomatic complexity 49 (threshold 15). Of this number, 46 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.
McpGameDataTools.SetStrings (cyclomatic 49) REDACTED:2234— McpGameDataTools.SetStrings has cyclomatic complexity 49 (threshold 15). Of this number, 46 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.
McpResourceTools.ImportPhysicsSystem (cyclomatic 49) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1805— McpResourceTools.ImportPhysicsSystem has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 14 of the 49 points are its own statements and the rest belongs to one function literal inside it that branches (line 1823). 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.
McpCameraTools.CreateCameraAnimation (cyclomatic 49) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:915— McpCameraTools.CreateCameraAnimation has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 12 of the 49 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 952, 978, 934). 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.
McpResourceTools.CheckCharacterAppearances (cyclomatic 48) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2558— McpResourceTools.CheckCharacterAppearances has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 2561, 2626). 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.
McpZoneTools.AutoZone (cyclomatic 48) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:526— McpZoneTools.AutoZone has cyclomatic complexity 48 (threshold 15). Of this number, 28 points are the body's own statements and 20 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.
ModExporterForm.PopulateTree (cyclomatic 47) Source/OpenCAGE/Popups/ModExporterForm.cs:419— ModExporterForm.PopulateTree has cyclomatic complexity 47 (threshold 15). Of this number, 46 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.
McpAssetTools.ImportTexture (cyclomatic 47) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1448— McpAssetTools.ImportTexture has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 9 of the 47 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1466, 1519). 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.
McpEditingTools.MoveEntities (cyclomatic 47) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:546— McpEditingTools.MoveEntities has cyclomatic complexity 47 (threshold 15). Of this number, 21 points are the body's own statements and 26 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.
McpPortingTools.FindInLevels (cyclomatic 47) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:303— McpPortingTools.FindInLevels 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.
McpSpatialTools.SampleSpace (cyclomatic 47) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:865— McpSpatialTools.SampleSpace has cyclomatic complexity 47 (threshold 15). Of this number, 46 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.
ModExporterForm.UpdateSummary (cyclomatic 46) Source/OpenCAGE/Popups/ModExporterForm.cs:1114— ModExporterForm.UpdateSummary has cyclomatic complexity 46 (threshold 15). Of this number, 35 points are the body's own statements and 11 belong to 6 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.
McpAnimationAssetTools.DescribeAnimatedProp (cyclomatic 46) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2523— McpAnimationAssetTools.DescribeAnimatedProp has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 5 of the 46 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2533, 2556, 2571). 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.
McpEditorTools.CompareComposite (cyclomatic 46) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1275— McpEditorTools.CompareComposite 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.
Flowgraph.PollStates (cyclomatic 45) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:404— Flowgraph.PollStates has cyclomatic complexity 45 (threshold 15). Of this number, 44 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.
CompositeDeleteEdit.Revert (cyclomatic 45) Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:265— CompositeDeleteEdit.Revert 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.
GUI_AnimationViewer.SetModel (cyclomatic 45) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:145— GUI_AnimationViewer.SetModel 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.
McpEditingTools.RemoveReferences (cyclomatic 45) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1568— McpEditingTools.RemoveReferences has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 5 of the 45 points are its own statements and the rest belongs to one function literal inside it that branches (line 1577). 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.
McpCharacterTools.DescribeNpc (cyclomatic 45) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1412— McpCharacterTools.DescribeNpc has cyclomatic complexity 45 (threshold 15). Of this number, 41 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.
McpZoneTools.PlanMove (cyclomatic 45) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1619— McpZoneTools.PlanMove 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.
AnimationImport.Read (cyclomatic 44) Source/OpenCAGE/Scripts/AnimationImport.cs:217— AnimationImport.Read 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.
McpCageAnimationTools.SetAnimationEvents (cyclomatic 44) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2979— McpCageAnimationTools.SetAnimationEvents has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 2 of the 44 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2985, 2997, 3055, …). 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.
McpEditorTools.CreateLevel (cyclomatic 44) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:699— McpEditorTools.CreateLevel has cyclomatic complexity 44 (threshold 15). Of this number, 41 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.
McpZoneTools.ApplyLinks (cyclomatic 44) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:244— McpZoneTools.ApplyLinks has cyclomatic complexity 44 (threshold 15). Of this number, 40 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.
AnimationTreeGraph.ClearTopPinReference (cyclomatic 43) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:566— AnimationTreeGraph.ClearTopPinReference 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.
McpAssetTools.EditModelInPlace (cyclomatic 43) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:894— McpAssetTools.EditModelInPlace has cyclomatic complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGameDataTools.SetInventoryItem (cyclomatic 43) REDACTED:1215— McpGameDataTools.SetInventoryItem has cyclomatic complexity 43 (threshold 15). Of this number, 41 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.
McpResourceTools.PlanRenderable (cyclomatic 43) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:815— McpResourceTools.PlanRenderable has cyclomatic complexity 43 (threshold 15). Of this number, 37 points are the body's own statements and 6 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.
CommandsEditor.ApplyAllOptionCheckboxesFromSettings (cyclomatic 42) Source/OpenCAGE/CommandsEditor.cs:2989— CommandsEditor.ApplyAllOptionCheckboxesFromSettings has cyclomatic complexity 42 (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.
ThemeEngine.ApplyDark (cyclomatic 42) Source/OpenCAGE/Scripts/Theming/ThemeEngine.cs:379— ThemeEngine.ApplyDark 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.
ModManagerForm.ApplyChanges (cyclomatic 42) Source/OpenCAGE/Popups/ModManagerForm.cs:1033— ModManagerForm.ApplyChanges has cyclomatic complexity 42 (threshold 15). Of this number, 40 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.
McpBrowseTools.GetComposite (cyclomatic 42) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:320— McpBrowseTools.GetComposite has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 322, 340, 359, …). 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.
McpPortingTools.PortComposites (cyclomatic 42) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:509— McpPortingTools.PortComposites has cyclomatic complexity 42 (threshold 15). Of this number, 17 points are the body's own statements and 25 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.
EditMaterial.materialList_SelectedIndexChanged (cyclomatic 41) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:612— EditMaterial.materialList_SelectedIndexChanged has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WwiseBankBuilder.Borrow (cyclomatic 41) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:340— WwiseBankBuilder.Borrow has cyclomatic complexity 41 (threshold 15). Of this number, 40 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.
McpAnimationAssetTools.GetCharacterAnimationProfile (cyclomatic 41) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2363— McpAnimationAssetTools.GetCharacterAnimationProfile has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 2367, 2478, 2478). 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.
McpAnimationAssetTools.EditBehaviourTree (cyclomatic 41) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4952— McpAnimationAssetTools.EditBehaviourTree has cyclomatic complexity 41 (threshold 15). Of this number, 40 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.
McpPortingTools.Place (cyclomatic 41) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:790— McpPortingTools.Place has cyclomatic complexity 41 (threshold 15). Of this number, 20 points are the body's own statements and 21 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.
McpZoneTools.Analyse (cyclomatic 41) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:598— McpZoneTools.Analyse has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.AnalyseZones (cyclomatic 41) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:128— McpZoneTools.AnalyseZones has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 132, 158, 162, …). 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.
McpAssetTools.EditModelGeometry (cyclomatic 40) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1065— McpAssetTools.EditModelGeometry 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.
McpBrowseTools.FindReferences (cyclomatic 40) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1342— McpBrowseTools.FindReferences has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1346, 1402). 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.
McpScriptEdit.ReachingThrough (cyclomatic 40) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1085— McpScriptEdit.ReachingThrough has cyclomatic complexity 40 (threshold 15). Of this number, 31 points are the body's own statements and 9 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.
McpScriptTools.Write (cyclomatic 40) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1264— McpScriptTools.Write has cyclomatic complexity 40 (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.
McpUsageTools.FindLinks (cyclomatic 40) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:1171— McpUsageTools.FindLinks has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 11 of the 40 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1186, 1233). 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.
ModInstaller.Analyze (cyclomatic 39) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:487— ModInstaller.Analyze has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpResourceTools.PlanCollision (cyclomatic 39) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1036— McpResourceTools.PlanCollision has cyclomatic complexity 39 (threshold 15). Of this number, 38 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.
AnimationTreeGraph.ClearFlowChildReference (cyclomatic 38) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:492— AnimationTreeGraph.ClearFlowChildReference has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompositeDisplay.RemapCopiedReferences (cyclomatic 38) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2512— CompositeDisplay.RemapCopiedReferences has cyclomatic complexity 38 (threshold 15). Of this number, 37 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.
McpDebugger.Run (cyclomatic 38) Source/OpenCAGE/Scripts/MCP/McpDebugger.cs:24— McpDebugger.Run has cyclomatic complexity 38 (threshold 15). Of this number, 24 points are the body's own statements and 14 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpImportTools.EditUiPak (cyclomatic 38) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1202— McpImportTools.EditUiPak has cyclomatic complexity 38 (threshold 15). Of this number, 35 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Geometry.DoorGuarantee (cyclomatic 38) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1112— Geometry.DoorGuarantee has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpSoundTools.PlaceSound (cyclomatic 38) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:374— McpSoundTools.PlaceSound has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 398, 436, 464). 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.
McpRegion.Resolve (cyclomatic 38) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:126— McpRegion.Resolve has cyclomatic complexity 38 (threshold 15). Of this number, 37 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.
LoadedGameFiles.AfterChange (cyclomatic 37) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:196— LoadedGameFiles.AfterChange has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body's own statements and 5 belong to 5 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.
EntityDeleteEdit.Revert (cyclomatic 37) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:319— EntityDeleteEdit.Revert 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.
WebSocketPacketLog.FormatSummary (cyclomatic 37) Source/OpenCAGE/Scripts/Unity Connection/WebSocketPacketLog.cs:26— WebSocketPacketLog.FormatSummary 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.
McpCageAnimationTools.PoseSamples (cyclomatic 37) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1054— McpCageAnimationTools.PoseSamples 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.
McpCageAnimationTools.SetTangents (cyclomatic 37) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2746— McpCageAnimationTools.SetTangents 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.
McpEditingTools.ListEnumStringValues (cyclomatic 37) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1473— McpEditingTools.ListEnumStringValues has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 6 of the 37 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1488, 1528). 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.
Geometry.Neighbours (cyclomatic 37) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:462— Geometry.Neighbours has cyclomatic complexity 37 (threshold 15). Of this number, 24 points are the body's own statements and 13 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.
AnimTreeCanvas.Populate (cyclomatic 36) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:421— AnimTreeCanvas.Populate 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.
ModExportBuilder.Summarise (cyclomatic 36) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:411— ModExportBuilder.Summarise has cyclomatic complexity 36 (threshold 15). Of this number, 25 points are the body's own statements and 11 belong to 5 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.
NodeUtils.AlignRelayRows (cyclomatic 36) Source/OpenCAGE/Scripts/NodeUtils.cs:500— NodeUtils.AlignRelayRows has cyclomatic complexity 36 (threshold 15). Of this number, 35 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.
McpMaterialTools.EditMapping (cyclomatic 36) REDACTED:933— McpMaterialTools.EditMapping has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 943, 949, 1062). 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.
McpViewportTools.Capture (cyclomatic 36) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:425— McpViewportTools.Capture has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 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.
LevelSoundOverride.Replace (cyclomatic 35) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:102— LevelSoundOverride.Replace has cyclomatic complexity 35 (threshold 15). Of this number, 32 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RefactorEdit.AfterChange (cyclomatic 35) Source/OpenCAGE/Scripts/Undo/RefactorEdit.cs:210— RefactorEdit.AfterChange has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCageAnimationTools.ResolveTransformKey (cyclomatic 35) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2483— McpCageAnimationTools.ResolveTransformKey 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.
McpPageTools.SetPins (cyclomatic 35) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:991— McpPageTools.SetPins has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 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.
McpPortingTools.ExportToLevels (cyclomatic 35) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1079— McpPortingTools.ExportToLevels 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpValidation.Walk (cyclomatic 35) Source/OpenCAGE/Scripts/MCP/McpTool.cs:666— McpValidation.Walk 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.
McpUsageTools.GetUsagePatterns (cyclomatic 35) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:470— McpUsageTools.GetUsagePatterns has cyclomatic complexity 35 (threshold 15). Of this number, 27 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EntityParameterProxy.BuildProperties (cyclomatic 34) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:237— EntityParameterProxy.BuildProperties 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.
McpAssetTools.EditTextureTool (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1767— McpAssetTools.EditTextureTool has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 1770, 1820, 1836, …). 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.
McpAnimationAssetTools.ListAnimations (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:949— McpAnimationAssetTools.ListAnimations has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 960, 1027). 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.
McpAnimationAssetTools.ListSkeletons (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1230— McpAnimationAssetTools.ListSkeletons has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1243, 1308, 1287). 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.
McpCageAnimationTools.RemoveTracks (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2848— McpCageAnimationTools.RemoveTracks has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 belong to 5 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.
McpLevelTools.EditorOptions (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:799— McpLevelTools.EditorOptions has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 831). 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.
McpEditorTools.SaveLevel (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1383— McpEditorTools.SaveLevel has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpViewportTools.Place (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2294— McpViewportTools.Place has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 11 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 2308, 2354, 2365, …). 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.
McpSoundTools.LevelSoundPackage (cyclomatic 34) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:556— McpSoundTools.LevelSoundPackage has cyclomatic complexity 34 (threshold 15). Of this number, 30 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.
LiveLinkTrace.Step (cyclomatic 34) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:376— LiveLinkTrace.Step 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.
WaveFile.Read (cyclomatic 33) Source/OpenCAGE/Scripts/Audio/WaveFile.cs:54— WaveFile.Read 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.
ModExporterForm.Export (cyclomatic 33) Source/OpenCAGE/Popups/ModExporterForm.cs:1315— ModExporterForm.Export has cyclomatic complexity 33 (threshold 15). Of this number, 18 points are the body's own statements and 15 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.
CurveEditor.DrawEventLanes (cyclomatic 33) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1202— CurveEditor.DrawEventLanes 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.
ModelIO.ToSubmesh (cyclomatic 33) Source/OpenCAGE/Scripts/ModelIO.cs:1568— ModelIO.ToSubmesh has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
EntityDeleteEdit.FindReaching (cyclomatic 33) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:279— EntityDeleteEdit.FindReaching has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCageAnimationTools.Describe (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:634— McpCageAnimationTools.Describe has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGameDataTools.SetXmlRecord (cyclomatic 33) REDACTED:785— McpGameDataTools.SetXmlRecord 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.
McpBrowseTools.GetEffectiveParameters (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:530— McpBrowseTools.GetEffectiveParameters has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 537, 622, 625). 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.
McpBrowseTools.FindOverrides (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:696— McpBrowseTools.FindOverrides 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.
McpEffective.Of (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpScript.cs:691— McpEffective.Of has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpViewportTools.SetCamera (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1139— McpViewportTools.SetCamera 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.
McpViewportTools.Pick (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1662— McpViewportTools.Pick has cyclomatic complexity 33 (threshold 15). Of this number, 24 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.ZoneIn (cyclomatic 33) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:638— McpZoneTools.ZoneIn has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Program.Handle (cyclomatic 33) Source/OpenCAGE.MCP/Program.cs:276— Program.Handle 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.
CommandsEditor.SaveLevelCore (cyclomatic 32) Source/OpenCAGE/CommandsEditor.cs:1897— CommandsEditor.SaveLevelCore 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.
ModLevelMerger.Extract (cyclomatic 32) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:144— ModLevelMerger.Extract has cyclomatic complexity 32 (threshold 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, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CurveEditor.LeftButtonDown (cyclomatic 32) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2017— CurveEditor.LeftButtonDown 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.
ViewerResourceSync.Sync (cyclomatic 32) Source/OpenCAGE/Scripts/Unity Connection/ViewerResourceSync.cs:304— ViewerResourceSync.Sync has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
McpAnimationAssetTools.ImportReport (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1804— McpAnimationAssetTools.ImportReport has cyclomatic complexity 32 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGlobalAssetChecks.AnimationProblems (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5724— McpGlobalAssetChecks.AnimationProblems has cyclomatic complexity 32 (threshold 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: 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.
McpCageAnimationTools.ResolveChannel (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2014— McpCageAnimationTools.ResolveChannel has cyclomatic complexity 32 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCageAnimationTools.ReadTransformKey (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2154— McpCageAnimationTools.ReadTransformKey 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.
McpEditingTools.DescribePlacement (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1395— McpEditingTools.DescribePlacement 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.
McpLevelTools.CaptureEnvironmentMaps (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1429— McpLevelTools.CaptureEnvironmentMaps has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Geometry.Potts (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:802— Geometry.Potts 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.
McpZoneTools.DoorProblems (cyclomatic 32) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:753— McpZoneTools.DoorProblems 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.
CompositeEntityList.NaturalCompare (cyclomatic 31) Source/OpenCAGE/Popups/UserControls/CompositeEntityList.cs:909— CompositeEntityList.NaturalCompare 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.
MaterialApplier.GetDiffuseTint (cyclomatic 31) Source/OpenCAGE/Scripts/MaterialApplier.cs:645— MaterialApplier.GetDiffuseTint 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.
McpAnimationAssetTools.DescribeSoundEvent (cyclomatic 31) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5218— McpAnimationAssetTools.DescribeSoundEvent has cyclomatic complexity 31 (threshold 15). Of this number, 28 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.
McpLevelTools.SetPlayerStart (cyclomatic 31) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1941— McpLevelTools.SetPlayerStart has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1956, 1989, 2021). 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.
McpPortingTools.SearchLevel (cyclomatic 31) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:139— McpPortingTools.SearchLevel has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 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.
McpScript.Describe (cyclomatic 31) Source/OpenCAGE/Scripts/MCP/McpScript.cs:414— McpScript.Describe has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnimTreeCanvas.SetTopPin (cyclomatic 30) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1194— AnimTreeCanvas.SetTopPin 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. This is NOT this file's highest cyclomatic complexity: AnimTreeCanvas.PinsOf (cyclomatic 34) 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 method is counted neither in this dimension's figures nor in its score.
ModelIO.FitUVsInRange (cyclomatic 30) Source/OpenCAGE/Scripts/ModelIO.cs:2314— ModelIO.FitUVsInRange 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.
Program.Main (cyclomatic 30) Source/OpenCAGE/Program.cs:32— Program.Main 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.
McpAnimationAssetTools.Coerce (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3534— McpAnimationAssetTools.Coerce 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.
McpAnimationAssetTools.ApplyBehaviourOp (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4883— McpAnimationAssetTools.ApplyBehaviourOp 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.
McpAnimationAssetTools.ListSoundBanks (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5140— McpAnimationAssetTools.ListSoundBanks has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 5152, 5205, 5195). 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.
McpCageAnimationTools.AnimateParameters (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1675— McpCageAnimationTools.AnimateParameters has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 1687). 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.
McpLevelTools.PlayerSetup (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1831— McpLevelTools.PlayerSetup has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1843, 1897, 1837). 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.
McpResourceTools.ApplyAttributes (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2501— McpResourceTools.ApplyAttributes 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.
McpEditorTools.DuplicateLevel (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:937— McpEditorTools.DuplicateLevel has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 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.
McpErrorCodes.Infer (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpTool.cs:195— McpErrorCodes.Infer has cyclomatic complexity 30 (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.
McpNames.Score (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpTool.cs:840— McpNames.Score 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.
Pointers.Pointers.ctor (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:793— Pointers.Pointers.ctor has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpRegion.FindPlaces (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:609— McpRegion.FindPlaces 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.
McpZoneTools.ContentPath (cyclomatic 30) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:732— McpZoneTools.ContentPath has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 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.
LiveLinkCameraSync.Step (cyclomatic 30) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:352— LiveLinkCameraSync.Step 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.
CommandsEditor.ApplySettingEffects (cyclomatic 29) Source/OpenCAGE/CommandsEditor.cs:3089— CommandsEditor.ApplySettingEffects has cyclomatic complexity 29 (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.
AlienConfigEditor.Save (cyclomatic 29) Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:100— AlienConfigEditor.Save has cyclomatic complexity 29 (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.
GraphicsEditor.GraphicsEditor.ctor (cyclomatic 29) Source/OpenCAGE/Popups/Configuration Editors/GraphicsEditor.cs:21— GraphicsEditor.GraphicsEditor.ctor 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.
AssetUsage.TexturesOnlyUsedBy (cyclomatic 29) Source/OpenCAGE/Scripts/AssetUsage.cs:163— AssetUsage.TexturesOnlyUsedBy 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.
CurveEditor.MouseMovedTo (cyclomatic 29) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2558— CurveEditor.MouseMovedTo 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.
McpCageAnimationTools.FindAnimations (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:880— McpCageAnimationTools.FindAnimations has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 882, 933). 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.
McpCageAnimationTools.EditTrack (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2636— McpCageAnimationTools.EditTrack 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.
McpCageAnimationTools.PreviewInGame (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3784— McpCageAnimationTools.PreviewInGame has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 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.
McpEditingTools.ClearInstanceOverrides (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:693— McpEditingTools.ClearInstanceOverrides has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 703, 748). 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.
McpEditorTools.WaitForGame (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1739— McpEditorTools.WaitForGame 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.
McpScript.FindComposite (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpScript.cs:82— McpScript.FindComposite has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpScriptEdit.Run (cyclomatic 29) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:110— McpScriptEdit.Run has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 114, 142, 166, …). 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.
LiveLinkAnimationDrive.Describe (cyclomatic 29) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:466— LiveLinkAnimationDrive.Describe has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
LiveLinkCameraSync.Follow (cyclomatic 29) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:479— LiveLinkCameraSync.Follow 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.
AmmoEditor.Save (cyclomatic 28) Source/OpenCAGE/Popups/Configuration Editors/AmmoEditor.cs:204— AmmoEditor.Save 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.
AnimationPakMerge.MergeGlobalClips (cyclomatic 28) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:407— AnimationPakMerge.MergeGlobalClips 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.
CompositeDeleteEdit.Apply (cyclomatic 28) Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:132— CompositeDeleteEdit.Apply has cyclomatic complexity 28 (threshold 15). 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, 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.
ViewerSelectionSync.ApplyCore (cyclomatic 28) Source/OpenCAGE/Scripts/Unity Connection/ViewerSelectionSync.cs:114— ViewerSelectionSync.ApplyCore 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.
McpAssetTools.Scope (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:659— McpAssetTools.Scope 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.
McpAssetTools.ExportTextures (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1659— McpAssetTools.ExportTextures has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 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.
McpAnimationAssetTools.GetBehaviourTree (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4759— McpAnimationAssetTools.GetBehaviourTree has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Connection.CallTool (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpServer.cs:519— Connection.CallTool has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpSpatialTools.Volume (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1408— McpSpatialTools.Volume 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.
McpCameraTools.AnimateCameraPath (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:814— McpCameraTools.AnimateCameraPath has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 839, 824). 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.
McpCollision.Gather (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:305— McpCollision.Gather 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.
McpRegion.ResolveComposite (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:285— McpRegion.ResolveComposite has cyclomatic complexity 28 (threshold 15). 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: 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.
McpZoneTools.CreateZone (cyclomatic 28) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:932— McpZoneTools.CreateZone has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 971, 948, 954, …). 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.
LiveLinkActivity.Apply (cyclomatic 28) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkActivity.cs:417— LiveLinkActivity.Apply 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.
DifficultyEditor.SaveAlienConfig (cyclomatic 27) Source/OpenCAGE/Popups/Configuration Editors/DifficultyEditor.cs:225— DifficultyEditor.SaveAlienConfig 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.
LevelSoundOverrideEditor.Read (cyclomatic 27) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:223— LevelSoundOverrideEditor.Read 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.
LevelSoundOverride.Revert (cyclomatic 27) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:282— LevelSoundOverride.Revert 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.
SoundImport.Layout (cyclomatic 27) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:82— SoundImport.Layout 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.
SoundImport.Conform (cyclomatic 27) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:546— SoundImport.Conform 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.
AnimationPakMerge.MergeSetClips (cyclomatic 27) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:296— AnimationPakMerge.MergeSetClips 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.
ParameterGridPanel.CopyParameterValue (cyclomatic 27) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:612— ParameterGridPanel.CopyParameterValue 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.
McpPageTools.RemoveNodes (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:907— McpPageTools.RemoveNodes 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.
McpEditorTools.DiffLevel (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1150— McpEditorTools.DiffLevel has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpScriptTools.Prepare (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:604— McpScriptTools.Prepare 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.
McpResults.Fit (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpTool.cs:1039— McpResults.Fit 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.
McpViewportTools.GetState (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:579— McpViewportTools.GetState has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 583). 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.
McpViewportTools.ResolveLookThrough (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1348— McpViewportTools.ResolveLookThrough 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.
McpSoundTools.ListDialogueLines (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:302— McpSoundTools.ListDialogueLines has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 308, 348, 341, …). 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.
McpCharacterTools.DescribeNpcTool (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1361— McpCharacterTools.DescribeNpcTool has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1372, 1395, 1397). 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.
McpLightTools.Describe (cyclomatic 27) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:382— McpLightTools.Describe 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.
CommandsEditor.recaptureAllCubemapsToolStripMenuItem_Click (cyclomatic 26) Source/OpenCAGE/CommandsEditor.cs:813— CommandsEditor.recaptureAllCubemapsToolStripMenuItem_Click has cyclomatic complexity 26 (threshold 15). Of this number, 25 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.
DeltaCodec.FindOps (cyclomatic 26) Source/OpenCAGE/Scripts/Modding/DeltaCodec.cs:137— DeltaCodec.FindOps 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.
PhysicsSystemImporter.Import (cyclomatic 26) Source/OpenCAGE/Scripts/PhysicsSystemImporter.cs:127— PhysicsSystemImporter.Import 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.
CAGEAnimationEditor.RebuildTrackTree (cyclomatic 26) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:723— CAGEAnimationEditor.RebuildTrackTree 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.
ModelIO.TryReadBones (cyclomatic 26) Source/OpenCAGE/Scripts/ModelIO.cs:1742— ModelIO.TryReadBones 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.
SkinnedSubmesh.Build (cyclomatic 26) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:473— SkinnedSubmesh.Build 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.
McpAssetTools.SetGalaxy (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2087— McpAssetTools.SetGalaxy 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.
McpAnimationAssetTools.DescribeAnimation (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1059— McpAnimationAssetTools.DescribeAnimation has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1068, 1132). 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.
McpCageAnimationTools.MatchEvents (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3279— McpCageAnimationTools.MatchEvents 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.
McpGameDataTools.ResetConfigsTool (cyclomatic 26) REDACTED:2926— McpGameDataTools.ResetConfigsTool 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.
McpMaterialTools.ListMaterials (cyclomatic 26) REDACTED:178— McpMaterialTools.ListMaterials has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 180, 205, 201, …). 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.
McpMaterialTools.DescribeMaterial (cyclomatic 26) REDACTED:223— McpMaterialTools.DescribeMaterial has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpEditorTools.DeleteLevel (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1044— McpEditorTools.DeleteLevel has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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.
McpViewportTools.FreshPreview (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2466— McpViewportTools.FreshPreview has cyclomatic complexity 26 (threshold 15). Of this number, 23 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.
McpCameraTools.Build (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:405— McpCameraTools.Build has cyclomatic complexity 26 (threshold 15). Of this number, 19 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.
McpZoneTools.FindDoor (cyclomatic 26) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1960— McpZoneTools.FindDoor 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.
LaunchGame.PdbPath (cyclomatic 25) Source/OpenCAGE/Popups/LaunchGame.cs:551— LaunchGame.PdbPath 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.
AssetUsage.FindMaterialReferences (cyclomatic 25) Source/OpenCAGE/Scripts/AssetUsage.cs:66— AssetUsage.FindMaterialReferences 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.
WwiseBankBuilder.Build (cyclomatic 25) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:81— WwiseBankBuilder.Build has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThemeEngine.Restore (cyclomatic 25) Source/OpenCAGE/Scripts/Theming/ThemeEngine.cs:776— ThemeEngine.Restore 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.
CollisionProxyImporter.Import (cyclomatic 25) Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:200— CollisionProxyImporter.Import 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.
LevelContent.Save (cyclomatic 25) Source/OpenCAGE/Scripts/LevelContent.cs:177— LevelContent.Save 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.
CurveEditor.UpdateHover (cyclomatic 25) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2470— CurveEditor.UpdateHover 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.
ModelIO.PlacementWarning (cyclomatic 25) Source/OpenCAGE/Scripts/ModelIO.cs:1246— ModelIO.PlacementWarning 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.
GlobalEntitySearchHelper.JumpToEntity (cyclomatic 25) Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:211— GlobalEntitySearchHelper.JumpToEntity 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.
TreeUtility.UpdateFileTree (cyclomatic 25) Source/OpenCAGE/Scripts/TreeUtility.cs:69— TreeUtility.UpdateFileTree 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.
McpAssetTools.SetModelMaterial (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:763— McpAssetTools.SetModelMaterial has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 769, 838, 791, …). 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.
McpAnimationAssetTools.ResolveField (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3437— McpAnimationAssetTools.ResolveField 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.
McpCageAnimationTools.AnimatedBy (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:828— McpCageAnimationTools.AnimatedBy has cyclomatic complexity 25 (threshold 15). Of this number, 23 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.
McpLevelTools.DescribeActivity (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1306— McpLevelTools.DescribeActivity 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.
McpLevelTools.Animate (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1610— McpLevelTools.Animate has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpPortingTools.PortPlan (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1002— McpPortingTools.PortPlan 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.
McpScriptEdit.SetTriggerSequence (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:702— McpScriptEdit.SetTriggerSequence has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpScriptEdit.Delete (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:987— McpScriptEdit.Delete has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpViewportTools.RunAction (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1984— McpViewportTools.RunAction has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
Geometry.ComputePartition (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:624— Geometry.ComputePartition has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpUsageTools.Report (cyclomatic 25) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:593— McpUsageTools.Report has cyclomatic complexity 25 (threshold 15). Of this number, 22 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.
LiveLinkDebugger.Poll (cyclomatic 25) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:799— LiveLinkDebugger.Poll has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScatterChart::(anonymous)::label (cyclomatic 25) Source/WebAPI/dashboard_app.js:164— ScatterChart::(anonymous)::label 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.
AnimTreeCanvas.CanDraw (cyclomatic 24) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:974— AnimTreeCanvas.CanDraw 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. This is NOT this file's highest cyclomatic complexity: AnimTreeCanvas.PinsOf (cyclomatic 34) 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 method is counted neither in this dimension's figures nor in its score.
CompositeBrowser.UpdateFlatListInPlace (cyclomatic 24) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:828— CompositeBrowser.UpdateFlatListInPlace 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.
Flowgraph.UpdatePinValueTexts (cyclomatic 24) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.PinValues.cs:113— Flowgraph.UpdatePinValueTexts 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.
WwiseVorbisWriter.Build (cyclomatic 24) Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:59— WwiseVorbisWriter.Build 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.
WwiseMediaInjector.ReplaceInBank (cyclomatic 24) Source/OpenCAGE/Scripts/Audio/WwiseMediaInjector.cs:284— WwiseMediaInjector.ReplaceInBank 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.
InstallScanner.Scan (cyclomatic 24) Source/OpenCAGE/Scripts/Modding/InstallScanner.cs:81— InstallScanner.Scan has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BmlPatch.Apply (cyclomatic 24) REDACTED:219— BmlPatch.Apply 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.
LevelPartDependencies.Reached (cyclomatic 24) Source/OpenCAGE/Scripts/Modding/LevelPart.cs:75— LevelPartDependencies.Reached 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsManager.SaveOnce (cyclomatic 24) Source/OpenCAGE/Scripts/SettingsManager.cs:486— SettingsManager.SaveOnce 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpAssetTools.ExportModel (cyclomatic 24) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:443— McpAssetTools.ExportModel has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 459). 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.
McpGameDataTools.SetVoiceMappings (cyclomatic 24) REDACTED:1957— McpGameDataTools.SetVoiceMappings 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.
McpImportTools.ImportPackageOnDisk (cyclomatic 24) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1026— McpImportTools.ImportPackageOnDisk has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 5 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.
McpCollision.AddModelCollider (cyclomatic 24) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:435— McpCollision.AddModelCollider has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpCollision.Bounds (cyclomatic 24) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:579— McpCollision.Bounds 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.
McpRegion.ResolveZone (cyclomatic 24) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:228— McpRegion.ResolveZone has cyclomatic complexity 24 (threshold 15). Of this number, 19 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.
EditAnimationMetadata.PutEntry (cyclomatic 23) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:544— EditAnimationMetadata.PutEntry 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.
EditAnimationMetadata.PutSetting (cyclomatic 23) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:633— EditAnimationMetadata.PutSetting has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Flowgraph.ProcessCmdKey (cyclomatic 23) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:964— Flowgraph.ProcessCmdKey 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.
ImportCompositeArchive.ImportIntoLevelsOnDisk (cyclomatic 23) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:413— ImportCompositeArchive.ImportIntoLevelsOnDisk 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.
EditMaterial.BuildParameterGroupBox (cyclomatic 23) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:301— EditMaterial.BuildParameterGroupBox has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SoundImport.Shape (cyclomatic 23) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:148— SoundImport.Shape 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.
WwiseBankBuilder.Write (cyclomatic 23) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:674— WwiseBankBuilder.Write has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 702, 718, 725, …). 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.
Pak2Merge.Merge (cyclomatic 23) REDACTED:194— Pak2Merge.Merge 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.
PhysicsSystemImporter.SetBodyProperties (cyclomatic 23) Source/OpenCAGE/Scripts/PhysicsSystemImporter.cs:182— PhysicsSystemImporter.SetBodyProperties 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.
CathodeLibExtensions.ExportMesh (cyclomatic 23) Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:539— CathodeLibExtensions.ExportMesh has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CathodeLibExtensions.GetDdsSurfaceSize (cyclomatic 28) 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 method is counted neither in this dimension's figures nor in its score.
ModelIO.RescaleSubmeshes (cyclomatic 23) Source/OpenCAGE/Scripts/ModelIO.cs:1904— ModelIO.RescaleSubmeshes 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.
ListViewGroupNavigation.OnKeyDown (cyclomatic 23) Source/OpenCAGE/Scripts/ListViewGroupNavigation.cs:45— ListViewGroupNavigation.OnKeyDown 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.
EntityParameterProxy.CreateDescriptor (cyclomatic 23) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:455— EntityParameterProxy.CreateDescriptor 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.
McpAssetTools.DescribeModel (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:324— McpAssetTools.DescribeModel has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 330, 384). 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.
McpAnimationAssetTools.SetTreeField (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3597— McpAnimationAssetTools.SetTreeField 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.
McpAnimationAssetTools.EditAnimTree (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3988— McpAnimationAssetTools.EditAnimTree has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4003, 4055). 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.
McpCageAnimationTools.CallsFromElsewhere (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1253— McpCageAnimationTools.CallsFromElsewhere has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGameDataTools.StringsOfEntity (cyclomatic 23) REDACTED:2136— McpGameDataTools.StringsOfEntity has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpPageTools.FindNode (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:699— McpPageTools.FindNode 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.
McpResourceTools.SetRenderable (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:734— McpResourceTools.SetRenderable 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 4 function literals inside it that branch (lines 736, 755, 784, …). 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.
McpBrowseTools.DescribeFunctionType (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1505— McpBrowseTools.DescribeFunctionType has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1509, 1529). 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.
McpScriptEdit.SetParameter (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1158— McpScriptEdit.SetParameter 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.
McpUsageTools.Example (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:692— McpUsageTools.Example 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.
McpZoneTools.ChangeContents (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1127— McpZoneTools.ChangeContents has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.DeleteZone (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1282— McpZoneTools.DeleteZone has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.ApplyMove (cyclomatic 23) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1784— McpZoneTools.ApplyMove has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
Flowgraph.RefreshDebugMarks (cyclomatic 22) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:177— Flowgraph.RefreshDebugMarks has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExportComposite.export_Click (cyclomatic 22) Source/OpenCAGE/Popups/ExportComposite.cs:58— ExportComposite.export_Click has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModState.Load (cyclomatic 22) Source/OpenCAGE/Scripts/Modding/ModState.cs:96— ModState.Load 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.
MergeConflict.Place (cyclomatic 22) Source/OpenCAGE/Scripts/Modding/Merging/MergeCore.cs:45— MergeConflict.Place 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.
Writer.Element (cyclomatic 22) REDACTED:604— Writer.Element 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.
FlowgraphLayoutManager.TrimLayoutsForDeletion (cyclomatic 22) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:346— FlowgraphLayoutManager.TrimLayoutsForDeletion 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.
CurveEditor.BuildContextMenu (cyclomatic 22) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1880— CurveEditor.BuildContextMenu has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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.
VertexSource.Get (cyclomatic 22) Source/OpenCAGE/Scripts/ModelIO.cs:2246— VertexSource.Get 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.
EntityDeleteEdit.Remove (cyclomatic 22) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:142— EntityDeleteEdit.Remove has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ZoneColours.ZoneColours.ctor (cyclomatic 22) Source/OpenCAGE/Scripts/ZoneColours.cs:95— ZoneColours.ZoneColours.ctor 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.
EditModel.RebuildModelFileTree (cyclomatic 22) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:147— EditModel.RebuildModelFileTree has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShowCrossRefs.GetEntityRefs (cyclomatic 22) Source/OpenCAGE/Popups/ShowCrossRefs.cs:254— ShowCrossRefs.GetEntityRefs has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 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.
McpAssetTools.EditModelTool (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:603— McpAssetTools.EditModelTool has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpCageAnimationTools.UpdateEvent (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3363— McpCageAnimationTools.UpdateEvent 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.
McpGameDataTools.SetAssetSet (cyclomatic 22) REDACTED:1789— McpGameDataTools.SetAssetSet 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.
McpResourceTools.GetEntityResources (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:421— McpResourceTools.GetEntityResources has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 423). 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.
McpPortingTools.DescribeLevelComposite (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:440— McpPortingTools.DescribeLevelComposite has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpActivity.SaysNoChange (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpServer.cs:905— McpActivity.SaysNoChange has cyclomatic complexity 22 (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.
McpPlatformTools.Decorate (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:300— McpPlatformTools.Decorate has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 329, 346, 321). 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.
McpCharacterTools.FindNpcs (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:300— McpCharacterTools.FindNpcs has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 320, 326, 331). 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.
McpRegion.Score (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:540— McpRegion.Score 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 cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpZoneTools.UnitsIn (cyclomatic 22) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:827— McpZoneTools.UnitsIn 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.
EditAnimationMetadata.Parse (cyclomatic 21) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:687— EditAnimationMetadata.Parse 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.
EditAnimations.UsersOf (cyclomatic 21) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:1071— EditAnimations.UsersOf has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CompositeDisplay.LoadEntity (cyclomatic 21) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1930— CompositeDisplay.LoadEntity has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to one function literal inside it that branches. 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.
CompositeDisplay.CloneClipboardEntities (cyclomatic 21) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2408— CompositeDisplay.CloneClipboardEntities 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.
EntityInspector.AddDefaults (cyclomatic 21) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:967— EntityInspector.AddDefaults has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
LevelBackupManager.backupAllNow_Click (cyclomatic 21) Source/OpenCAGE/Popups/LevelBackupManager.cs:364— LevelBackupManager.backupAllNow_Click has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LevelSoundOverride.Finish (cyclomatic 21) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:676— LevelSoundOverride.Finish 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.
HashCache.HashAll (cyclomatic 21) Source/OpenCAGE/Scripts/Modding/HashCache.cs:124— HashCache.HashAll has cyclomatic complexity 21 (threshold 15). Of this number, 12 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.
ModInstaller.CheckFile (cyclomatic 21) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:705— ModInstaller.CheckFile 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ModManagerForm.ShowScanSummary (cyclomatic 21) Source/OpenCAGE/Popups/ModManagerForm.cs:402— ModManagerForm.ShowScanSummary 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.
FlowgraphManagerUtils.LinksMatch (cyclomatic 21) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1119— FlowgraphManagerUtils.LinksMatch has cyclomatic complexity 21 (threshold 15). 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.
CompositePreviewManager.ApplyCaptureResults (cyclomatic 21) Source/OpenCAGE/Scripts/CompositePreviewManager.cs:849— CompositePreviewManager.ApplyCaptureResults 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.
FbxBinary.WriteProperty (cyclomatic 21) Source/OpenCAGE/Scripts/ModelExport/FbxDocument.cs:126— FbxBinary.WriteProperty has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 5 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.
EditorUtils.CloseAI (cyclomatic 21) Source/OpenCAGE/Scripts/EditorUtils.cs:566— EditorUtils.CloseAI 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. This is NOT this file's highest cyclomatic complexity: EditorUtils.GetImageIndexForCompositePinType (cyclomatic 30) 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 method is counted neither in this dimension's figures nor in its score.
EntityParameterProxy.RefreshParameterStatuses (cyclomatic 21) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:167— EntityParameterProxy.RefreshParameterStatuses 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.
McpAnimationAssetTools.WriteFields (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3221— McpAnimationAssetTools.WriteFields 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.
McpCageAnimationTools.ApplyBindings (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3165— McpCageAnimationTools.ApplyBindings has cyclomatic complexity 21 (threshold 15). Of this number, 17 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.
McpCageAnimationTools.AddEvent (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3221— McpCageAnimationTools.AddEvent has cyclomatic complexity 21 (threshold 15). Of this number, 17 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.
McpEditingTools.MoveComposites (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1037— McpEditingTools.MoveComposites 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.
Step.Resolve (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1884— Step.Resolve 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.
McpMaterialTools.Bind (cyclomatic 21) REDACTED:737— McpMaterialTools.Bind has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpResourceTools.Effective (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:492— McpResourceTools.Effective 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.
McpResourceTools.SetCollision (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:936— McpResourceTools.SetCollision has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 938, 955). 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.
McpResourceTools.GetCharacterAppearance (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2195— McpResourceTools.GetCharacterAppearance has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 2197). 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.
McpDialogs.Sweep (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpEditor.cs:531— McpDialogs.Sweep has cyclomatic complexity 21 (threshold 15). Of this number, 18 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.
McpScriptEdit.WhyValueIgnored (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1364— McpScriptEdit.WhyValueIgnored has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpViewportTools.DescribePick (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1783— McpViewportTools.DescribePick 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.
Filter.Ok (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1348— Filter.Ok 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.
Nearest.Query (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1418— Nearest.Query 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.
McpSpatialTools.TransformPoints (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1477— McpSpatialTools.TransformPoints has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpSpatialTools.ExportRegionCollision (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1760— McpSpatialTools.ExportRegionCollision has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpSoundTools.FindSpareSoundEvents (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:497— McpSoundTools.FindSpareSoundEvents has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 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.
McpZoneTools.LinkZones (cyclomatic 21) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:403— McpZoneTools.LinkZones has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnimationSkeletonPicker.Score (cyclomatic 20) Source/OpenCAGE/Popups/Resource Editors/AnimationSkeletonPicker.cs:123— AnimationSkeletonPicker.Score 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.
AnimationNodeProxy.AddMember (cyclomatic 20) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:103— AnimationNodeProxy.AddMember 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.
CompositeDisplay.LoadEntities (cyclomatic 20) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1873— CompositeDisplay.LoadEntities 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, 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.
CompositeDisplay.CreateVariableEntityCore (cyclomatic 20) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3209— CompositeDisplay.CreateVariableEntityCore 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.
EntityInspector.DescribeStoredPath (cyclomatic 20) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1794— EntityInspector.DescribeStoredPath 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.
Flowgraph.ShowFlowgraph (cyclomatic 20) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:828— Flowgraph.ShowFlowgraph has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Flowgraph.deleteToolStripMenuItem_Click (cyclomatic 20) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1555— Flowgraph.deleteToolStripMenuItem_Click has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LevelSoundOverrideEditor.RemoveSelected (cyclomatic 20) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:489— LevelSoundOverrideEditor.RemoveSelected has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AlienLevel.RestoreBackup (cyclomatic 20) Source/OpenCAGE/Scripts/AlienLevel.cs:354— AlienLevel.RestoreBackup 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.
SoundImport.Encode (cyclomatic 20) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:351— SoundImport.Encode 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.
MaterialApplier.GetEmissiveTint (cyclomatic 20) Source/OpenCAGE/Scripts/MaterialApplier.cs:1371— MaterialApplier.GetEmissiveTint 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. This is NOT this file's highest cyclomatic complexity: MaterialApplier.GetDiffuseMapSamplerIndex (cyclomatic 22) 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 method is counted neither in this dimension's figures nor in its score.
XmlLayout.Scan (cyclomatic 20) REDACTED:527— XmlLayout.Scan 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.
CollisionProxyImporter.FromModelFile (cyclomatic 20) Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:54— CollisionProxyImporter.FromModelFile 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.
CurveEditor.LeftButtonUp (cyclomatic 20) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2686— CurveEditor.LeftButtonUp 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.
CAGEAnimationEditor.ConfirmRemovingStringEvents (cyclomatic 20) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.AnimationMode.cs:777— CAGEAnimationEditor.ConfirmRemovingStringEvents 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.
Document.BuildSkins (cyclomatic 20) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:341— Document.BuildSkins 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.
ModelIO.BuildAnimation (cyclomatic 20) Source/OpenCAGE/Scripts/ModelIO.cs:612— ModelIO.BuildAnimation 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.
ModelImportRig.ScoreFit (cyclomatic 20) Source/OpenCAGE/Scripts/ModelImportRig.cs:145— ModelImportRig.ScoreFit 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.
EntityParameterVisibility.IsHiddenFromEditor (cyclomatic 20) Source/OpenCAGE/Scripts/EntityParameterVisibility.cs:13— EntityParameterVisibility.IsHiddenFromEditor 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.
ViewerClipboardSync.ApplyCore (cyclomatic 20) Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:43— ViewerClipboardSync.ApplyCore 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.
McpAssetTools.ExportModels (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:513— McpAssetTools.ExportModels 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.
McpAnimationAssetTools.ApplyTreeOp (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3769— McpAnimationAssetTools.ApplyTreeOp 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.
Working.Commit (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1535— Working.Commit has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
McpPlacements.WalkIn (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:2135— McpPlacements.WalkIn 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.
McpGameDataTools.EditorsFor (cyclomatic 20) REDACTED:221— McpGameDataTools.EditorsFor 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.
McpGameDataTools.Choices (cyclomatic 20) REDACTED:675— McpGameDataTools.Choices 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.
McpGameDataTools.SetRecipe (cyclomatic 20) REDACTED:1524— McpGameDataTools.SetRecipe 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.
McpResourceTools.ResolveCharacter (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2070— McpResourceTools.ResolveCharacter 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.
McpBrowseTools.SameData (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1326— McpBrowseTools.SameData has cyclomatic complexity 20 (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.
McpEditorTools.State (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:496— McpEditorTools.State 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.
McpImportTools.Tools (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:24— McpImportTools.Tools has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 180, 146, 125, …). 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.
McpPortingTools.PlanPlacement (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:748— McpPortingTools.PlanPlacement 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.
McpValues.ToJson (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpScript.cs:899— McpValues.ToJson has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpValues.DescribePin (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpScript.cs:962— McpValues.DescribePin 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.
McpScriptTools.NoteUnzoned (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2122— McpScriptTools.NoteUnzoned has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Geometry.Tokens (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:706— Geometry.Tokens 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.
McpPlatformTools.Activity (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:54— McpPlatformTools.Activity has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 84, 82, 62). 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.
McpCameraTools.CheckPath (cyclomatic 20) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:700— McpCameraTools.CheckPath 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.
ViewerParameterSync.ApplyCore (cyclomatic 20) Source/OpenCAGE/Scripts/Unity Connection/ViewerParameterSync.cs:225— ViewerParameterSync.ApplyCore 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.
LiveLink.ParseAnimation (cyclomatic 20) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:834— LiveLink.ParseAnimation 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.
CommandsEditor.DescribeSaveFailure (cyclomatic 19) Source/OpenCAGE/CommandsEditor.cs:2148— CommandsEditor.DescribeSaveFailure 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.
EditAnimationMetadata.Same (cyclomatic 19) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:871— EditAnimationMetadata.Same 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.
AnimTreeCanvas.ArrangeAll (cyclomatic 19) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:649— AnimTreeCanvas.ArrangeAll has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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: AnimTreeCanvas.PinsOf (cyclomatic 34) 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 method is counted neither in this dimension's figures nor in its score.
AnimTreeCanvas.ApplyDrawnLink (cyclomatic 19) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1046— AnimTreeCanvas.ApplyDrawnLink 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. This is NOT this file's highest cyclomatic complexity: AnimTreeCanvas.PinsOf (cyclomatic 34) 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 method is counted neither in this dimension's figures nor in its score.
AnimTreeCanvas.SetFlowChild (cyclomatic 19) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1141— AnimTreeCanvas.SetFlowChild 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. This is NOT this file's highest cyclomatic complexity: AnimTreeCanvas.PinsOf (cyclomatic 34) 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 method is counted neither in this dimension's figures nor in its score.
CompositeDisplay.Reload (cyclomatic 19) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1037— CompositeDisplay.Reload 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.
Flowgraph.ConfigureBreakpointItems (cyclomatic 19) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:251— Flowgraph.ConfigureBreakpointItems 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.
InventoryItemEditor.Save (cyclomatic 19) Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:237— InventoryItemEditor.Save 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.
LaunchGame.WriteScriptingHelpersConfig (cyclomatic 19) Source/OpenCAGE/Popups/LaunchGame.cs:894— LaunchGame.WriteScriptingHelpersConfig 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. This is NOT this file's highest cyclomatic complexity: LaunchGame.ApplyExternalSettings (cyclomatic 24) 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 method is counted neither in this dimension's figures nor in its score.
WwiseBankBuilder.Reachable (cyclomatic 19) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:190— WwiseBankBuilder.Reachable has cyclomatic complexity 19 (threshold 15). Of this number, 16 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, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
Node.Parse (cyclomatic 19) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:520— Node.Parse 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.
MaterialGenerator.FacesPointBothWays (cyclomatic 19) Source/OpenCAGE/Scripts/MaterialGenerator.cs:411— MaterialGenerator.FacesPointBothWays 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. This is NOT this file's highest cyclomatic complexity: MaterialGenerator.DefaultPriority (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
MaterialGenerator.TryNearestPermutation (cyclomatic 19) Source/OpenCAGE/Scripts/MaterialGenerator.cs:778— MaterialGenerator.TryNearestPermutation 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. This is NOT this file's highest cyclomatic complexity: MaterialGenerator.DefaultPriority (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
ModInstaller.ResolveChecked (cyclomatic 19) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:772— ModInstaller.ResolveChecked 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (ModInstaller.Resolve) 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.
ModInstaller.Resolve (cyclomatic 19) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2045— ModInstaller.Resolve has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 2063). 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (ModInstaller.ResolveChecked) 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.
EditorTables.Absorb (cyclomatic 19) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:404— EditorTables.Absorb 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.
LayoutTrim.RestoreInto (cyclomatic 19) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:217— LayoutTrim.RestoreInto has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GUI_SplineViewer.ShowSpline (cyclomatic 19) Source/OpenCAGE/Popups/UserControls/GUI_SplineViewer.xaml.cs:45— GUI_SplineViewer.ShowSpline 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.
AnimationImport.BoneFor (cyclomatic 19) Source/OpenCAGE/Scripts/AnimationImport.cs:603— AnimationImport.BoneFor 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.
GUI_AnimationViewer.Refresh (cyclomatic 19) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:314— GUI_AnimationViewer.Refresh 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.
EnumStringPopupEditor.EditValue (cyclomatic 19) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:871— EnumStringPopupEditor.EditValue has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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.
TreeUtility.AddFileToTree (cyclomatic 19) Source/OpenCAGE/Scripts/TreeUtility.cs:341— TreeUtility.AddFileToTree 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.
McpAnimationAssetTools.RemoveAnimation (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1883— McpAnimationAssetTools.RemoveAnimation has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1895, 1934). 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.
McpAnimationAssetTools.CollectHits (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3889— McpAnimationAssetTools.CollectHits 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.
McpEditingTools.GetPlacements (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1197— McpEditingTools.GetPlacements has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1205). 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.
McpGameDataTools.ListStrings (cyclomatic 19) REDACTED:2079— McpGameDataTools.ListStrings 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.
McpPageTools.AddNodes (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:800— McpPageTools.AddNodes has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpBrowseTools.Tools (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:27— McpBrowseTools.Tools has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 197, 249, 255). 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.
McpBrowseTools.FindComposites (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:275— McpBrowseTools.FindComposites has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 281, 287). 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.
McpEditorTools.LevelArgument (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1797— McpEditorTools.LevelArgument 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.
McpEditorTools.Step (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2337— McpEditorTools.Step has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 2345). 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.
McpImportTools.FinishImport (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:554— McpImportTools.FinishImport has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpImportTools.ImportPackage (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:934— McpImportTools.ImportPackage has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 955, 973, 939, …). 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.
McpScriptTools.StepRemoveParameters (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1586— McpScriptTools.StepRemoveParameters has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpCharacterTools.Resolve (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:425— McpCharacterTools.Resolve 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.
McpZoneTools.DescribeLink (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:463— McpZoneTools.DescribeLink 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.
McpZoneTools.GetZoneLinks (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:523— McpZoneTools.GetZoneLinks has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 527). 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.
McpZoneTools.OutsideContent (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2621— McpZoneTools.OutsideContent has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 2634). 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.
McpZoneTools.AreaComposite (cyclomatic 19) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2660— McpZoneTools.AreaComposite has cyclomatic complexity 19 (threshold 15). Of this number, 10 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.
LiveLinkDebugger.SendKept (cyclomatic 19) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:935— LiveLinkDebugger.SendKept 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.
LiveLinkDebugger.ParseList (cyclomatic 19) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1143— LiveLinkDebugger.ParseList 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.
Singleton.ListAnimations (cyclomatic 19) Source/OpenCAGE/Scripts/Singleton.cs:267— Singleton.ListAnimations has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 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.
Program.Main (cyclomatic 19) Source/OpenCAGE.MCP/Program.cs:88— Program.Main 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.
CompositeDisplay.PopulateUI (cyclomatic 18) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:896— CompositeDisplay.PopulateUI has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CompositeBrowser.FileTree_MouseDown (cyclomatic 18) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1675— CompositeBrowser.FileTree_MouseDown 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.
CompositeArchive.Extract (cyclomatic 18) Source/OpenCAGE/Scripts/CompositeArchive.cs:426— CompositeArchive.Extract 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.
AlienLevel.RestoreSome (cyclomatic 18) Source/OpenCAGE/Scripts/AlienLevel.cs:515— AlienLevel.RestoreSome 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.
WwiseSoundBank.ParseDialogueEvent (cyclomatic 18) Source/OpenCAGE/Scripts/Audio/WwiseSoundBank.cs:379— WwiseSoundBank.ParseDialogueEvent 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.
MaterialApplier.GetShaderColorParameter (cyclomatic 18) Source/OpenCAGE/Scripts/MaterialApplier.cs:807— MaterialApplier.GetShaderColorParameter 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: MaterialApplier.GetDiffuseMapSamplerIndex (cyclomatic 22) 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 method is counted neither in this dimension's figures nor in its score.
BmlPatch.DiffElement (cyclomatic 18) REDACTED:118— BmlPatch.DiffElement 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.
ModExportBuilder.FriendlyConfigName (cyclomatic 18) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:559— ModExportBuilder.FriendlyConfigName 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.
PakParts.PutLine (cyclomatic 18) Source/OpenCAGE/Scripts/Modding/PakParts.cs:497— PakParts.PutLine has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModInstaller.NewFileCheck (cyclomatic 18) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:660— ModInstaller.NewFileCheck 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.
XmlMerge.MergeChildren (cyclomatic 18) REDACTED:110— XmlMerge.MergeChildren 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.
LevelContent.GenerateListViewItem (cyclomatic 18) Source/OpenCAGE/Scripts/LevelContent.cs:426— LevelContent.GenerateListViewItem 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.
Document.BuildNode (cyclomatic 18) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:432— Document.BuildNode 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.
ModelIO.SetSkinnedBounds (cyclomatic 18) Source/OpenCAGE/Scripts/ModelIO.cs:525— ModelIO.SetSkinnedBounds 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.
ModelIO.CreateImportPlan (cyclomatic 18) Source/OpenCAGE/Scripts/ModelIO.cs:1150— ModelIO.CreateImportPlan 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.
AnimationRetarget.Retarget (cyclomatic 18) Source/OpenCAGE/Scripts/AnimationRetarget.cs:705— AnimationRetarget.Retarget 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.
ResourceSessionEdit.ReferencesEqual (cyclomatic 18) Source/OpenCAGE/Scripts/Undo/SessionEdits.cs:293— ResourceSessionEdit.ReferencesEqual 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.
EditModel.ApplyImportedRig (cyclomatic 18) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:372— EditModel.ApplyImportedRig 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.
EditModel.deleteBtn_Click (cyclomatic 18) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:598— EditModel.deleteBtn_Click 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.
ViewerEntitySync.AliasesWithReasonToStay (cyclomatic 18) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:336— ViewerEntitySync.AliasesWithReasonToStay 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.
McpAssetTools.DescribeTexture (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1376— McpAssetTools.DescribeTexture 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 1378). 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.
McpAnimationAssetTools.DescribeRig (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1334— McpAnimationAssetTools.DescribeRig has cyclomatic complexity 18 (threshold 15). Of this number, 16 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.
McpCageAnimationTools.DescribeFloatTrack (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:739— McpCageAnimationTools.DescribeFloatTrack 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.
McpResourceTools.Resolve (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:304— McpResourceTools.Resolve 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.
McpEditorTools.ReadImports (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2111— McpEditorTools.ReadImports has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpScriptEdit.Show (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:276— McpScriptEdit.Show has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
McpScriptEdit.AddVariable (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:558— McpScriptEdit.AddVariable 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.
McpScriptEdit.BuildOverrideIndex (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1413— McpScriptEdit.BuildOverrideIndex 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.
McpScriptTools.Aim (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1121— McpScriptTools.Aim 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.
Connection.Receive (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpServer.cs:351— Connection.Receive has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
McpTool.Invoke (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpTool.cs:72— McpTool.Invoke 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.
McpSoundTools.BankLoaders (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:171— McpSoundTools.BankLoaders 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.
McpCameraTools.KeepClear (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:645— McpCameraTools.KeepClear 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.
McpCharacterTools.MainCharacter (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:120— McpCharacterTools.MainCharacter 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.
McpLightTools.BehaviourOf (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:280— McpLightTools.BehaviourOf has cyclomatic complexity 18 (threshold 15). Of this number, 16 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.
McpValueSource.Of (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1125— McpValueSource.Of 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.
McpUsageTools.Build (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:272— McpUsageTools.Build 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.
McpRegion.Index (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:717— McpRegion.Index has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 738). 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.
McpZoneTools.LinksOfZone (cyclomatic 18) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:569— McpZoneTools.LinksOfZone has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScriptErrorLog.Poll (cyclomatic 18) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:201— ScriptErrorLog.Poll 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.
Program.HandleOne (cyclomatic 18) Source/OpenCAGE.MCP/Program.cs:153— Program.HandleOne 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.
EditAnimations.FillSets (cyclomatic 17) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:381— EditAnimations.FillSets 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.
AnimationPreview.BadFitWarning (cyclomatic 17) Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:545— AnimationPreview.BadFitWarning 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.
CompositeDisplay.ApplyViewerSelectionPath (cyclomatic 17) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1110— CompositeDisplay.ApplyViewerSelectionPath 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.
CompositeDisplay.CloneEntityForPaste (cyclomatic 17) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2595— CompositeDisplay.CloneEntityForPaste 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.
CompositeBrowser.SelectCompositeInListView (cyclomatic 17) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1346— CompositeBrowser.SelectCompositeInListView 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.
Flowgraph.RefreshActivityBadges (cyclomatic 17) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:171— Flowgraph.RefreshActivityBadges 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.
LevelTextDBEditor.levelList_SelectedIndexChanged (cyclomatic 17) REDACTED:115— LevelTextDBEditor.levelList_SelectedIndexChanged 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.
GalaxyEditor.GetRangeError (cyclomatic 17) Source/OpenCAGE/Popups/GalaxyEditor.cs:116— GalaxyEditor.GetRangeError has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
LevelSoundOverrideEditor.Rebuild (cyclomatic 17) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:158— LevelSoundOverrideEditor.Rebuild has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 189, 172, 204, …). 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.
SelectEnumString.PopulateItems (cyclomatic 17) Source/OpenCAGE/Popups/SelectEnumString.cs:168— SelectEnumString.PopulateItems 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.
SoundEventMetadata.Lookup (cyclomatic 17) Source/OpenCAGE/Scripts/Audio/SoundEventMetadata.cs:94— SoundEventMetadata.Lookup 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.
EnvironmentMapCapture.PrepareAsync (cyclomatic 17) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:359— EnvironmentMapCapture.PrepareAsync 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.
EnvironmentMapCapture.Use (cyclomatic 17) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:622— EnvironmentMapCapture.Use 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.
WwiseVorbisConverter.Parse (cyclomatic 17) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:89— WwiseVorbisConverter.Parse 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.
SoundPreviewPanel.Replace (cyclomatic 17) Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:610— SoundPreviewPanel.Replace 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.
MaterialApplier.ApplyMaterial (cyclomatic 17) Source/OpenCAGE/Scripts/MaterialApplier.cs:250— MaterialApplier.ApplyMaterial 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. This is NOT this file's highest cyclomatic complexity: MaterialApplier.GetDiffuseMapSamplerIndex (cyclomatic 22) 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 method is counted neither in this dimension's figures nor in its score.
MaterialGenerator.Describe (cyclomatic 17) Source/OpenCAGE/Scripts/MaterialGenerator.cs:204— MaterialGenerator.Describe 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. This is NOT this file's highest cyclomatic complexity: MaterialGenerator.DefaultPriority (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
ModInstaller.RewriteEverywhere (cyclomatic 17) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1059— ModInstaller.RewriteEverywhere 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ModInstaller.ComposeFile (cyclomatic 17) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2145— ModInstaller.ComposeFile 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
EditorTables.CombinePages (cyclomatic 17) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:481— EditorTables.CombinePages has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XmlMerge.Match (cyclomatic 17) REDACTED:264— XmlMerge.Match 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.
Writer.Pairs (cyclomatic 17) REDACTED:665— Writer.Pairs 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.
LineMerge.Lcs (cyclomatic 17) Source/OpenCAGE/Scripts/Modding/Merging/TextMerge.cs:310— LineMerge.Lcs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
PristineCaptureWizard.RunCheckAndCapture (cyclomatic 17) Source/OpenCAGE/Popups/PristineCaptureWizard.cs:176— PristineCaptureWizard.RunCheckAndCapture has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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.
AnimationPakWrite.PrepareTrees (cyclomatic 17) Source/OpenCAGE/Scripts/AnimationPakWrite.cs:125— AnimationPakWrite.PrepareTrees has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CathodeLibExtensions.ForceStringNumeric (cyclomatic 17) Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:650— CathodeLibExtensions.ForceStringNumeric 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. This is NOT this file's highest cyclomatic complexity: CathodeLibExtensions.GetDdsSurfaceSize (cyclomatic 28) 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 method is counted neither in this dimension's figures nor in its score.
ModelIO.ToAssimpMesh (cyclomatic 17) Source/OpenCAGE/Scripts/ModelIO.cs:994— ModelIO.ToAssimpMesh has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table. This is NOT this file's highest cyclomatic complexity: ModelIO.SizeOf (cyclomatic 18) 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 method is counted neither in this dimension's figures nor in its score.
LocalDebug.CheckWriteInstanced (cyclomatic 17) Source/OpenCAGE/Scripts/LocalDebug.cs:124— LocalDebug.CheckWriteInstanced 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.
NodeUtils.CollectTriggerSequenceMethods (cyclomatic 17) Source/OpenCAGE/Scripts/NodeUtils.cs:31— NodeUtils.CollectTriggerSequenceMethods 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.
EditorUtils.ForceStringNumeric (cyclomatic 17) Source/OpenCAGE/Scripts/EditorUtils.cs:453— EditorUtils.ForceStringNumeric 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. This is NOT this file's highest cyclomatic complexity: EditorUtils.GetImageIndexForCompositePinType (cyclomatic 30) 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 method is counted neither in this dimension's figures nor in its score.
ModelEditor.RefreshSelectedModelPreview (cyclomatic 17) Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:327— ModelEditor.RefreshSelectedModelPreview 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.
TreeUtility.MatchNode (cyclomatic 17) Source/OpenCAGE/Scripts/TreeUtility.cs:257— TreeUtility.MatchNode 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.
ParameterSync.Pack (cyclomatic 17) Source/OpenCAGE/Scripts/Unity Connection/ParameterSync.cs:46— ParameterSync.Pack has cyclomatic complexity 17 (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.
McpAnimationAssetTools.ClipIndexes (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1557— McpAnimationAssetTools.ClipIndexes 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.
McpAnimationAssetTools.PreviewAnimation (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2141— McpAnimationAssetTools.PreviewAnimation has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 2160). 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.
McpAnimationAssetTools.ListBlendSets (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2805— McpAnimationAssetTools.ListBlendSets 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 2 function literals inside it that branch (lines 2810, 2868). 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.
McpAnimationAssetTools.LinkField (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3694— McpAnimationAssetTools.LinkField 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.
McpAnimationAssetTools.UnlinkField (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3733— McpAnimationAssetTools.UnlinkField 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.
McpAnimationAssetTools.CheckTreeClips (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3950— McpAnimationAssetTools.CheckTreeClips 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.
McpEditingTools.DeleteComposites (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1121— McpEditingTools.DeleteComposites has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpGameDataTools.SetSoundbanks (cyclomatic 17) REDACTED:1618— McpGameDataTools.SetSoundbanks 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. This is NOT this file's highest cyclomatic complexity: McpGameDataTools.GetRecord (cyclomatic 18) 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 method is counted neither in this dimension's figures nor in its score.
McpMaterialTools.CreateMaterial (cyclomatic 17) REDACTED:425— McpMaterialTools.CreateMaterial 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 5 function literals inside it that branch (lines 429, 470, 475, …). 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.
McpMaterialTools.ListPermutations (cyclomatic 17) REDACTED:802— McpMaterialTools.ListPermutations 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 3 function literals inside it that branch (lines 804, 855, 849). 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.
McpResourceTools.DescribeRenderable (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:597— McpResourceTools.DescribeRenderable 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.
McpResourceTools.ImportCollisionProxy (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1516— McpResourceTools.ImportCollisionProxy has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 1531). 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.
McpBrowseTools.DescribeEntity (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:445— McpBrowseTools.DescribeEntity 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 2 function literals inside it that branch (lines 448, 474). 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.
McpLevels.Resolve (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2417— McpLevels.Resolve 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, 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.
McpImportTools.DescribeImportPlan (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:636— McpImportTools.DescribeImportPlan has cyclomatic complexity 17 (threshold 15). Of this number, 12 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.
McpImportTools.InspectPackage (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:863— McpImportTools.InspectPackage has cyclomatic complexity 17 (threshold 15). 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: 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.
McpPortingTools.DisplayModelsFor (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:707— McpPortingTools.DisplayModelsFor 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.
McpScriptTools.Place (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1065— McpScriptTools.Place 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.
McpCollision.AddBoxCollider (cyclomatic 17) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:503— McpCollision.AddBoxCollider has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table. This is NOT this file's highest cyclomatic complexity: Record.Passes (cyclomatic 22) 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 method is counted neither in this dimension's figures nor in its score.
LiveLinkAnimationDrive.Step (cyclomatic 17) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:296— LiveLinkAnimationDrive.Step 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.
LiveLinkDebugger.ShowEntity (cyclomatic 17) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:653— LiveLinkDebugger.ShowEntity 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.
Program.LaunchOrWait (cyclomatic 17) Source/OpenCAGE.MCP/Program.cs:505— Program.LaunchOrWait 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.
CommandsEditor.UpdateTitle (cyclomatic 16) Source/OpenCAGE/CommandsEditor.cs:596— CommandsEditor.UpdateTitle has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CommandsEditor.TryBuildLevelPanelsWhenReady (cyclomatic 16) Source/OpenCAGE/CommandsEditor.cs:1352— CommandsEditor.TryBuildLevelPanelsWhenReady has cyclomatic complexity 16 (threshold 15). 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: 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.
CommandsEditor.IsLeftDockLayoutValid (cyclomatic 16) Source/OpenCAGE/CommandsEditor.cs:1639— CommandsEditor.IsLeftDockLayoutValid 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.
CommandsEditor.LoadComposite (cyclomatic 16) Source/OpenCAGE/CommandsEditor.cs:1682— CommandsEditor.LoadComposite 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.
EditAnimationMetadata.Save (cyclomatic 16) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:744— EditAnimationMetadata.Save 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, 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.
EditAnimations.DeleteBtn_Click (cyclomatic 16) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:1005— EditAnimations.DeleteBtn_Click 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.
CompositeBrowser.BuildFolderList (cyclomatic 16) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:754— CompositeBrowser.BuildFolderList 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.
Flowgraph.SplitNode (cyclomatic 16) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:179— Flowgraph.SplitNode has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
Flowgraph.OnLiveLinkActivityChanged (cyclomatic 16) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:292— Flowgraph.OnLiveLinkActivityChanged 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.
Flowgraph.OnActivityTick (cyclomatic 16) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:387— Flowgraph.OnActivityTick 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.
InventoryItemEditor.listView_SelectedIndexChanged (cyclomatic 16) Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:108— InventoryItemEditor.listView_SelectedIndexChanged 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.
LocalisationHandler.RefreshLoadedStrings (cyclomatic 16) Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:315— LocalisationHandler.RefreshLoadedStrings 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.
LevelSoundImportDialog.Examine (cyclomatic 16) Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:581— LevelSoundImportDialog.Examine has cyclomatic complexity 16 (threshold 15). Of this number, 10 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.
LaunchGame.ApplyRuntimeUtils (cyclomatic 16) Source/OpenCAGE/Popups/LaunchGame.cs:393— LaunchGame.ApplyRuntimeUtils 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: LaunchGame.ApplyExternalSettings (cyclomatic 24) 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 method is counted neither in this dimension's figures nor in its score.
CompositeTree.Rebuild (cyclomatic 16) Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:354— CompositeTree.Rebuild 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.
TextureImportOptions.BuildPersistentSlider (cyclomatic 16) Source/OpenCAGE/Popups/Resource Editors/TextureImportOptions.cs:163— TextureImportOptions.BuildPersistentSlider 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, 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.
AnimationTimeline.Describe (cyclomatic 16) Source/OpenCAGE/Popups/UserControls/AnimationTimeline.cs:267— AnimationTimeline.Describe 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.
AlienLevel.PathsOf (cyclomatic 16) Source/OpenCAGE/Scripts/AlienLevel.cs:260— AlienLevel.PathsOf 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.
EnvironmentMapCapture.Placements (cyclomatic 16) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:175— EnvironmentMapCapture.Placements 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.
LevelSoundOverride.SetLevelEvents (cyclomatic 16) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:595— LevelSoundOverride.SetLevelEvents 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.
SoundSeekBar.OnPaint (cyclomatic 16) Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:958— SoundSeekBar.OnPaint 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.
ThemeManager.SetDark (cyclomatic 16) Source/OpenCAGE/Scripts/Theming/ThemeManager.cs:398— ThemeManager.SetDark 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.
MaterialConsistency.Check (cyclomatic 16) Source/OpenCAGE/Scripts/MaterialConsistency.cs:80— MaterialConsistency.Check 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.
ShaderDatabase.Build (cyclomatic 16) Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:424— ShaderDatabase.Build 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.
ModExportBuilder.Include (cyclomatic 16) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:186— ModExportBuilder.Include 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ModExportBuilder.Write (cyclomatic 16) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:346— ModExportBuilder.Write 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.
KeyedListMerge.Merge (cyclomatic 16) Source/OpenCAGE/Scripts/Modding/Merging/TextMerge.cs:34— KeyedListMerge.Merge 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.
ModExporterForm.AddLevelRows (cyclomatic 16) Source/OpenCAGE/Popups/ModExporterForm.cs:779— ModExporterForm.AddLevelRows 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.
ModExporterForm.SelectedParts (cyclomatic 16) Source/OpenCAGE/Popups/ModExporterForm.cs:1242— ModExporterForm.SelectedParts 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.
BuildFingerprint.Of (cyclomatic 16) Source/OpenCAGE/Scripts/BuildFingerprint.cs:71— BuildFingerprint.Of 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.
AnimTreeLayoutManager.Rekey (cyclomatic 16) Source/OpenCAGE/Scripts/AnimTreeLayoutManager.cs:176— AnimTreeLayoutManager.Rekey has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
EditorIcons.ForEntity (cyclomatic 16) Source/OpenCAGE/Scripts/EditorIcons.cs:542— EditorIcons.ForEntity 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: EditorIcons.ForAnimNodeType (cyclomatic 28) 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 method is counted neither in this dimension's figures nor in its score.
CurveEditor.ClampValueView (cyclomatic 16) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1654— CurveEditor.ClampValueView 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.
Document.BuildMesh (cyclomatic 16) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:192— Document.BuildMesh 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.
VertexSource.VertexSource.ctor (cyclomatic 16) Source/OpenCAGE/Scripts/ModelIO.cs:2130— VertexSource.VertexSource.ctor 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: ModelIO.SizeOf (cyclomatic 18) 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 method is counted neither in this dimension's figures nor in its score.
ModelImportRig.Examine (cyclomatic 16) Source/OpenCAGE/Scripts/ModelImportRig.cs:81— ModelImportRig.Examine 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.
CompositeInstanceParameters.Ensure (cyclomatic 16) Source/OpenCAGE/Scripts/CompositeInstanceParameters.cs:21— CompositeInstanceParameters.Ensure 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.
ParameterGridPanel.ResetParam_Click (cyclomatic 16) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:1233— ParameterGridPanel.ResetParam_Click 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.
ParameterSync.Unpack (cyclomatic 16) Source/OpenCAGE/Scripts/Unity Connection/ParameterSync.cs:190— ParameterSync.Unpack 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.
ViewerContextMenu.RequestAsViewport (cyclomatic 16) Source/OpenCAGE/Scripts/Unity Connection/ViewerContextMenu.cs:296— ViewerContextMenu.RequestAsViewport has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
McpAssetTools.Tools (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:23— McpAssetTools.Tools 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 6 function literals inside it that branch (lines 176, 44, 165, …). 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.
McpAssets.FindMaterial (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2225— McpAssets.FindMaterial 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.
McpAssets.PlacedBy (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2298— McpAssets.PlacedBy has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
McpAnimationAssetTools.EditAnimTreeLayout (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4239— McpAnimationAssetTools.EditAnimTreeLayout has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4277, 4252). 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.
McpGlobalAssetChecks.UnknownValueWarning (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5578— McpGlobalAssetChecks.UnknownValueWarning 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.
McpGlobalAssetChecks.Suggest (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5606— McpGlobalAssetChecks.Suggest 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.
McpLevelTools.GameDirectories (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:610— McpLevelTools.GameDirectories 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.
McpPageTools.MoveNodes (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:866— McpPageTools.MoveNodes 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.
McpResourceTools.ExportCollisionMesh (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1654— McpResourceTools.ExportCollisionMesh 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, 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.
McpFlowgraphTools.Layout (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:213— McpFlowgraphTools.Layout 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.
McpPortingTools.SourceAppearances (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:916— McpPortingTools.SourceAppearances has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpScriptTools.StepCreateComposite (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:876— McpScriptTools.StepCreateComposite 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.
McpScriptTools.Link (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1733— McpScriptTools.Link 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.
McpSpatialTools.Grid (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1365— McpSpatialTools.Grid 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.
McpCameraTools.Slopes (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:521— McpCameraTools.Slopes 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.
McpCameraTools.Measure (cyclomatic 16) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:565— McpCameraTools.Measure 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.
LiveLinkDebugger.PickFromGame (cyclomatic 16) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:575— LiveLinkDebugger.PickFromGame 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.
Program.SendLoop (cyclomatic 16) Source/OpenCAGE.MCP/Program.cs:404— Program.SendLoop 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.
D18 · Solution Shape· Solution references 4 projects that do not exist · ×1
Solution references 4 projects that do not exist Source/OpenCAGE.sln— `Source/OpenCAGE.sln` declares 4 project file(s) that are missing from the tree (`Source/CathodeLib/CathodeLib/CathodeLib.csproj`, `Source/DockPanelSuite/WinFormsUI/ThemeVS2015.csproj`, `Source/DockPanelSuite/WinFormsUI/WinFormsUI.csproj`, `Source/STNodeEditor/ST.Library.UI/ST.Library.UI.csproj`). A solution-level restore or build fails on a dangling reference, so anyone building the solution rather than an individual project is blocked. Delete the stale entry from the solution, or restore the missing project file.
McpUsageTools.TraceLinks (cognitive 343) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:852— McpUsageTools.TraceLinks has cognitive complexity 343 (threshold 15). Most of this is not in the body itself: 4 of the 343 points are its own statements and the rest belongs to one function literal inside it that branches (line 864). 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.
McpBrowseTools.FindEntities (cognitive 292) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:779— McpBrowseTools.FindEntities has cognitive complexity 292 (threshold 15). Of this number, 86 points are the body's own statements and 206 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Geometry.Geometry.ctor (cognitive 211) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:138— Geometry.Geometry.ctor has cognitive complexity 211 (threshold 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.
EnumStringListViewItems.AddItems (cognitive 189) Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:189— EnumStringListViewItems.AddItems has cognitive complexity 189 (threshold 15). 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.
McpEditingTools.CopySet (cognitive 181) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:324— McpEditingTools.CopySet has cognitive complexity 181 (threshold 15). Of this number, 180 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
PakParts.AnimationParts (cognitive 172) Source/OpenCAGE/Scripts/Modding/PakParts.cs:186— PakParts.AnimationParts has cognitive complexity 172 (threshold 15). Of this number, 159 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Geometry.AbsorbTiny (cognitive 169) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:924— Geometry.AbsorbTiny has cognitive complexity 169 (threshold 15). Of this number, 148 points are the body's own statements and 21 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.
McpImportTools.ImportModel (cognitive 166) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:272— McpImportTools.ImportModel has cognitive complexity 166 (threshold 15). Of this number, 29 points are the body's own statements and 137 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.
McpGameDataTools.EditElements (cognitive 147) REDACTED:2728— McpGameDataTools.EditElements has cognitive complexity 147 (threshold 15). Of this number, 146 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.
McpLevelTools.RuntimeUtils (cognitive 146) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:970— McpLevelTools.RuntimeUtils has cognitive complexity 146 (threshold 15). Of this number, 143 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.
McpCageAnimationTools.ApplySet (cognitive 145) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2338— McpCageAnimationTools.ApplySet has cognitive complexity 145 (threshold 15). Of this number, 143 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GUI_AnimationViewer.SetModel (cognitive 141) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:145— GUI_AnimationViewer.SetModel has cognitive complexity 141 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpLightTools.SetLights (cognitive 141) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:537— McpLightTools.SetLights has cognitive complexity 141 (threshold 15). Of this number, 38 points are the body's own statements and 103 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpZoneTools.PlanLinks (cognitive 137) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:935— McpZoneTools.PlanLinks has cognitive complexity 137 (threshold 15). Of this number, 135 points are the body's own statements and 2 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.
ModelIO.BuildScene (cognitive 132) Source/OpenCAGE/Scripts/ModelIO.cs:280— ModelIO.BuildScene has cognitive complexity 132 (threshold 15). Of this number, 131 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.
McpZoneTools.PlanAutoZones (cognitive 130) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:1127— McpZoneTools.PlanAutoZones has cognitive complexity 130 (threshold 15). Of this number, 127 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.
McpAssetTools.FindAssetUsers (cognitive 129) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1880— McpAssetTools.FindAssetUsers has cognitive complexity 129 (threshold 15). Most of this is not in the body itself: 3 of the 129 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1887, 2016, 2012, …). 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.
McpZoneTools.JoinZones (cognitive 129) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2096— McpZoneTools.JoinZones has cognitive complexity 129 (threshold 15). Of this number, 126 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpPortingTools.FindInLevels (cognitive 127) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:303— McpPortingTools.FindInLevels has cognitive complexity 127 (threshold 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.
McpViewportTools.SetView (cognitive 127) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:788— McpViewportTools.SetView has cognitive complexity 127 (threshold 15). None of this is in the body itself: all 127 points belong to one function literal inside it that branches (line 790). 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.
ModInstaller.ApplyConfigurationLocked (cognitive 125) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1675— ModInstaller.ApplyConfigurationLocked has cognitive complexity 125 (threshold 15). Of this number, 121 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCageAnimationTools.Retime (cognitive 125) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1779— McpCageAnimationTools.Retime has cognitive complexity 125 (threshold 15). Of this number, 116 points are the body's own statements and 9 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.
McpSpatialTools.Loop (cognitive 125) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1100— McpSpatialTools.Loop has cognitive complexity 125 (threshold 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.
NodeUtils.GetAllPinPositions (cognitive 118) Source/OpenCAGE/Scripts/NodeUtils.cs:146— NodeUtils.GetAllPinPositions has cognitive complexity 118 (threshold 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.
McpSpatialTools.GetBounds (cognitive 118) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:504— McpSpatialTools.GetBounds has cognitive complexity 118 (threshold 15). Of this number, 116 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.
McpZoneTools.CheckZones (cognitive 117) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2396— McpZoneTools.CheckZones has cognitive complexity 117 (threshold 15). Of this number, 17 points are the body's own statements and 100 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.
McpScriptEdit.RenamePin (cognitive 110) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:821— McpScriptEdit.RenamePin has cognitive complexity 110 (threshold 15). Of this number, 97 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.
McpScriptTools.StepSetParameters (cognitive 106) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1385— McpScriptTools.StepSetParameters has cognitive complexity 106 (threshold 15). Of this number, 98 points are the body's own statements and 8 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.
McpSpatialTools.Raycast (cognitive 106) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:690— McpSpatialTools.Raycast has cognitive complexity 106 (threshold 15). Of this number, 103 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.
McpZoneTools.MergeZones (cognitive 106) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1355— McpZoneTools.MergeZones has cognitive complexity 106 (threshold 15). Of this number, 97 points are the body's own statements and 9 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.
McpLevelTools.LaunchOptions (cognitive 105) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:380— McpLevelTools.LaunchOptions has cognitive complexity 105 (threshold 15). Of this number, 101 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.
McpZoneTools.BuildScene (cognitive 105) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:322— McpZoneTools.BuildScene has cognitive complexity 105 (threshold 15). Of this number, 76 points are the body's own statements and 29 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.
McpCameraTools.ReadPath (cognitive 104) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:140— McpCameraTools.ReadPath has cognitive complexity 104 (threshold 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.
NodeUtils.AddAllPins (cognitive 102) Source/OpenCAGE/Scripts/NodeUtils.cs:708— NodeUtils.AddAllPins has cognitive complexity 102 (threshold 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.
McpLevelTools.ExportMod (cognitive 101) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:2213— McpLevelTools.ExportMod has cognitive complexity 101 (threshold 15). Of this number, 94 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.
McpZoneTools.ApplyLinks (cognitive 101) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:244— McpZoneTools.ApplyLinks has cognitive complexity 101 (threshold 15). Of this number, 99 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.
McpAnimationAssetTools.ApplyLayoutAction (cognitive 100) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4357— McpAnimationAssetTools.ApplyLayoutAction has cognitive complexity 100 (threshold 15). Of this number, 97 points are the body's own statements and 3 belong to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
McpFlowgraphTools.Read (cognitive 100) Source/OpenCAGE/Scripts/MCP/McpFlowgraphTools.cs:57— McpFlowgraphTools.Read has cognitive complexity 100 (threshold 15). Of this number, 98 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.
McpSpatialTools.DropToFloor (cognitive 100) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1549— McpSpatialTools.DropToFloor has cognitive complexity 100 (threshold 15). Of this number, 34 points are the body's own statements and 66 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.
McpMaterialTools.EditMaterialTool (cognitive 96) REDACTED:521— McpMaterialTools.EditMaterialTool has cognitive complexity 96 (threshold 15). Most of this is not in the body itself: 8 of the 96 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 534, 684, 612, …). 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.
McpCharacterTools.SpawnNpcTool (cognitive 96) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1111— McpCharacterTools.SpawnNpcTool has cognitive complexity 96 (threshold 15). Of this number, 28 points are the body's own statements and 68 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.
McpGameDataTools.SetStrings (cognitive 95) REDACTED:2234— McpGameDataTools.SetStrings has cognitive complexity 95 (threshold 15). Of this number, 86 points are the body's own statements and 9 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.
McpAnimationAssetTools.EditBlendSet (cognitive 93) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2910— McpAnimationAssetTools.EditBlendSet has cognitive complexity 93 (threshold 15). Most of this is not in the body itself: 3 of the 93 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2927, 3059). 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.
McpZoneTools.Analyse (cognitive 93) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:598— McpZoneTools.Analyse has cognitive complexity 93 (threshold 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.
McpLevelTools.Mods (cognitive 92) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:2032— McpLevelTools.Mods has cognitive complexity 92 (threshold 15). Of this number, 87 points are the body's own statements and 5 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.
CompositeDisplay.RemapCopiedReferences (cognitive 90) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2512— CompositeDisplay.RemapCopiedReferences has cognitive complexity 90 (threshold 15). Of this number, 89 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpAnimationAssetTools.ClipSheet (cognitive 90) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2187— McpAnimationAssetTools.ClipSheet has cognitive complexity 90 (threshold 15). Of this number, 84 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.
McpEditingTools.RemoveReferences (cognitive 89) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1568— McpEditingTools.RemoveReferences has cognitive complexity 89 (threshold 15). Most of this is not in the body itself: 5 of the 89 points are its own statements and the rest belongs to one function literal inside it that branches (line 1577). 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.
CurveEditor.DrawEventLanes (cognitive 88) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1202— CurveEditor.DrawEventLanes has cognitive complexity 88 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpAnimationAssetTools.ImportAnimation (cognitive 88) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1591— McpAnimationAssetTools.ImportAnimation has cognitive complexity 88 (threshold 15). Of this number, 37 points are the body's own statements and 51 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.
McpCharacterTools.CreateNpcRoute (cognitive 88) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1582— McpCharacterTools.CreateNpcRoute has cognitive complexity 88 (threshold 15). Of this number, 58 points are the body's own statements and 30 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.
McpCharacterTools.PlayCharacterAnimation (cognitive 88) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1764— McpCharacterTools.PlayCharacterAnimation has cognitive complexity 88 (threshold 15). Of this number, 20 points are the body's own statements and 68 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.
Flowgraph.PollStates (cognitive 87) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:404— Flowgraph.PollStates has cognitive complexity 87 (threshold 15). Of this number, 86 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpAnimationAssetTools.ReplaceSound (cognitive 87) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5364— McpAnimationAssetTools.ReplaceSound has cognitive complexity 87 (threshold 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.
McpAnimationAssetTools.EditAnimationEvents (cognitive 86) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1952— McpAnimationAssetTools.EditAnimationEvents has cognitive complexity 86 (threshold 15). Of this number, 16 points are the body's own statements and 70 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.
McpZoneTools.PlanMove (cognitive 86) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1619— McpZoneTools.PlanMove has cognitive complexity 86 (threshold 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.
LiveLinkActivity.Apply (cognitive 86) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkActivity.cs:417— LiveLinkActivity.Apply has cognitive complexity 86 (threshold 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.
EntityInspector.Reload (cognitive 85) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:531— EntityInspector.Reload has cognitive complexity 85 (threshold 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.
McpNavTools.QueryNavmesh (cognitive 84) Source/OpenCAGE/Scripts/MCP/McpNavTools.cs:105— McpNavTools.QueryNavmesh has cognitive complexity 84 (threshold 15). Of this number, 80 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCageAnimationTools.Check (cognitive 83) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1303— McpCageAnimationTools.Check has cognitive complexity 83 (threshold 15). Of this number, 74 points are the body's own statements and 9 belong to 7 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.
LevelSoundOverride.Replace (cognitive 82) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:102— LevelSoundOverride.Replace has cognitive complexity 82 (threshold 15). Of this number, 80 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.
McpAssetTools.EditModelInPlace (cognitive 81) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:894— McpAssetTools.EditModelInPlace has cognitive complexity 81 (threshold 15). Of this number, 75 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
McpEditingTools.ListEnumStringValues (cognitive 81) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1473— McpEditingTools.ListEnumStringValues has cognitive complexity 81 (threshold 15). Most of this is not in the body itself: 4 of the 81 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1488, 1528). 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.
Geometry.DoorGuarantee (cognitive 81) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1112— Geometry.DoorGuarantee has cognitive complexity 81 (threshold 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.
ModExporterForm.PopulateTree (cognitive 80) Source/OpenCAGE/Popups/ModExporterForm.cs:419— ModExporterForm.PopulateTree has cognitive complexity 80 (threshold 15). Of this number, 78 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.
Pointers.Pointers.ctor (cognitive 80) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:793— Pointers.Pointers.ctor has cognitive complexity 80 (threshold 15). Of this number, 79 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.
McpAnimationAssetTools.GetCharacterAnimationProfile (cognitive 79) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2363— McpAnimationAssetTools.GetCharacterAnimationProfile has cognitive complexity 79 (threshold 15). None of this is in the body itself: all 79 points belong to 3 function literals inside it that branch (lines 2367, 2478, 2478). 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.
McpScriptTools.StepTriggerSequence (cognitive 77) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1880— McpScriptTools.StepTriggerSequence has cognitive complexity 77 (threshold 15). Of this number, 75 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.
AnimTreeCanvas.LinksOf (cognitive 76) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:248— AnimTreeCanvas.LinksOf has cognitive complexity 76 (threshold 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.
AnimTreeCanvas.Populate (cognitive 76) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:421— AnimTreeCanvas.Populate has cognitive complexity 76 (threshold 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.
GraphicsEditor.GraphicsEditor.ctor (cognitive 76) Source/OpenCAGE/Popups/Configuration Editors/GraphicsEditor.cs:21— GraphicsEditor.GraphicsEditor.ctor has cognitive complexity 76 (threshold 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.
McpResourceTools.SetCharacterAppearance (cognitive 76) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2305— McpResourceTools.SetCharacterAppearance has cognitive complexity 76 (threshold 15). None of this is in the body itself: all 76 points belong to one function literal inside it that branches (line 2307). 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.
McpEffective.Of (cognitive 76) Source/OpenCAGE/Scripts/MCP/McpScript.cs:691— McpEffective.Of has cognitive complexity 76 (threshold 15). Of this number, 69 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpEditorTools.LaunchGame (cognitive 75) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1545— McpEditorTools.LaunchGame has cognitive complexity 75 (threshold 15). Of this number, 67 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
McpAnimationAssetTools.DescribeAnimatedProp (cognitive 74) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2523— McpAnimationAssetTools.DescribeAnimatedProp has cognitive complexity 74 (threshold 15). Most of this is not in the body itself: 4 of the 74 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2533, 2556, 2571). 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.
McpResourceTools.CheckCharacterAppearances (cognitive 74) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2558— McpResourceTools.CheckCharacterAppearances has cognitive complexity 74 (threshold 15). None of this is in the body itself: all 74 points belong to 2 function literals inside it that branch (lines 2561, 2626). 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.
McpBrowseTools.FindReferences (cognitive 74) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1342— McpBrowseTools.FindReferences has cognitive complexity 74 (threshold 15). None of this is in the body itself: all 74 points belong to 2 function literals inside it that branch (lines 1346, 1402). 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.
McpCageAnimationTools.Preview (cognitive 73) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3560— McpCageAnimationTools.Preview has cognitive complexity 73 (threshold 15). Of this number, 43 points are the body's own statements and 30 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.
McpBrowseTools.FindOverrides (cognitive 72) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:696— McpBrowseTools.FindOverrides has cognitive complexity 72 (threshold 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.
McpPortingTools.Place (cognitive 72) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:790— McpPortingTools.Place has cognitive complexity 72 (threshold 15). Of this number, 29 points are the body's own statements and 43 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.
McpBrowseTools.GetComposite (cognitive 70) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:320— McpBrowseTools.GetComposite has cognitive complexity 70 (threshold 15). None of this is in the body itself: all 70 points belong to 4 function literals inside it that branch (lines 322, 359, 340, …). 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.
McpSpatialTools.Volume (cognitive 70) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1408— McpSpatialTools.Volume has cognitive complexity 70 (threshold 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.
McpEditorTools.Tools (cognitive 69) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:29— McpEditorTools.Tools has cognitive complexity 69 (threshold 15). None of this is in the body itself: all 69 points belong to 14 function literals inside it that branch (lines 307, 370, 239, …). 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.
McpGameDataTools.SetInventoryItem (cognitive 68) REDACTED:1215— McpGameDataTools.SetInventoryItem has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpLightTools.AddLight (cognitive 68) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:854— McpLightTools.AddLight has cognitive complexity 68 (threshold 15). Of this number, 41 points are the body's own statements and 27 belong to 4 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.
ModelIO.FitUVsInRange (cognitive 67) Source/OpenCAGE/Scripts/ModelIO.cs:2314— ModelIO.FitUVsInRange has cognitive complexity 67 (threshold 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.
McpAssetTools.PlaceModel (cognitive 67) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1224— McpAssetTools.PlaceModel has cognitive complexity 67 (threshold 15). Of this number, 20 points are the body's own statements and 47 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.
McpResourceTools.PlanRenderable (cognitive 67) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:815— McpResourceTools.PlanRenderable has cognitive complexity 67 (threshold 15). Of this number, 62 points are the body's own statements and 5 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.
McpAssetTools.EditModelGeometry (cognitive 66) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1065— McpAssetTools.EditModelGeometry has cognitive complexity 66 (threshold 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.
McpUsageTools.FindLinks (cognitive 66) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:1171— McpUsageTools.FindLinks has cognitive complexity 66 (threshold 15). Most of this is not in the body itself: 6 of the 66 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1186, 1233). 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.
McpZoneTools.AnalyseZones (cognitive 66) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:128— McpZoneTools.AnalyseZones has cognitive complexity 66 (threshold 15). None of this is in the body itself: all 66 points belong to 4 function literals inside it that branch (lines 132, 158, 162, …). 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.
CompositeDeleteEdit.Revert (cognitive 65) Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:265— CompositeDeleteEdit.Revert has cognitive complexity 65 (threshold 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.
McpEditingTools.MoveEntities (cognitive 65) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:546— McpEditingTools.MoveEntities has cognitive complexity 65 (threshold 15). Of this number, 18 points are the body's own statements and 47 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.
LoadedGameFiles.BeforeChange (cognitive 64) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:56— LoadedGameFiles.BeforeChange has cognitive complexity 64 (threshold 15). Of this number, 59 points are the body's own statements and 5 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.
EntityDeleteEdit.FindReaching (cognitive 63) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:279— EntityDeleteEdit.FindReaching has cognitive complexity 63 (threshold 15). Of this number, 62 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.
McpAnimationAssetTools.ImportReport (cognitive 63) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1804— McpAnimationAssetTools.ImportReport has cognitive complexity 63 (threshold 15). Of this number, 62 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.
McpEditorTools.CompareComposite (cognitive 63) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1275— McpEditorTools.CompareComposite has cognitive complexity 63 (threshold 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.
McpEditorTools.WaitForGame (cognitive 63) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1739— McpEditorTools.WaitForGame has cognitive complexity 63 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpZoneTools.AutoZone (cognitive 63) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:526— McpZoneTools.AutoZone has cognitive complexity 63 (threshold 15). Of this number, 40 points are the body's own statements and 23 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpGameDataTools.SetTextDatabases (cognitive 62) REDACTED:2479— McpGameDataTools.SetTextDatabases has cognitive complexity 62 (threshold 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.
McpImportTools.EditUiPak (cognitive 62) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1202— McpImportTools.EditUiPak has cognitive complexity 62 (threshold 15). Of this number, 60 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.
McpCharacterTools.DescribeNpc (cognitive 62) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1412— McpCharacterTools.DescribeNpc has cognitive complexity 62 (threshold 15). Of this number, 59 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.
DeltaCodec.FindOps (cognitive 61) Source/OpenCAGE/Scripts/Modding/DeltaCodec.cs:137— DeltaCodec.FindOps has cognitive complexity 61 (threshold 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.
McpAssetTools.ImportTexture (cognitive 61) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1448— McpAssetTools.ImportTexture has cognitive complexity 61 (threshold 15). Most of this is not in the body itself: 9 of the 61 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1519, 1466). 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.
McpAnimationAssetTools.ListSkeletons (cognitive 60) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1230— McpAnimationAssetTools.ListSkeletons has cognitive complexity 60 (threshold 15). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1243, 1308, 1287). 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.
McpCageAnimationTools.AnimatedBy (cognitive 60) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:828— McpCageAnimationTools.AnimatedBy has cognitive complexity 60 (threshold 15). Of this number, 59 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.
McpCageAnimationTools.SetAnimatedModel (cognitive 60) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3945— McpCageAnimationTools.SetAnimatedModel has cognitive complexity 60 (threshold 15). None of this is in the body itself: all 60 points belong to 8 function literals inside it that branch (lines 3947, 3969, 3977, …). 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.
McpPageTools.RemoveNodes (cognitive 60) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:907— McpPageTools.RemoveNodes has cognitive complexity 60 (threshold 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.
Geometry.Potts (cognitive 60) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:802— Geometry.Potts has cognitive complexity 60 (threshold 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.
dashboard_app.App (cognitive 60) Source/WebAPI/dashboard_app.js:352— dashboard_app.App has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 18 (35 pts), boolean chains 16, if/else 9 (nesting depth added 17). Of this number, 38 points are the body's own statements and 22 belong to 9 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.
McpScriptTools.Make (cognitive 59) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:929— McpScriptTools.Make has cognitive complexity 59 (threshold 15). Of this number, 58 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.
CompositeEntityList.NaturalCompare (cognitive 58) Source/OpenCAGE/Popups/UserControls/CompositeEntityList.cs:909— CompositeEntityList.NaturalCompare has cognitive complexity 58 (threshold 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.
McpPageTools.SetPins (cognitive 58) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:991— McpPageTools.SetPins has cognitive complexity 58 (threshold 15). Of this number, 54 points are the body's own statements and 4 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.
McpScriptEdit.ReachingThrough (cognitive 58) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1085— McpScriptEdit.ReachingThrough has cognitive complexity 58 (threshold 15). Of this number, 52 points are the body's own statements and 6 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.
AnimationTreeGraph.ClearTopPinReference (cognitive 57) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:566— AnimationTreeGraph.ClearTopPinReference has cognitive complexity 57 (threshold 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.
AttributesEditor.Save (cognitive 57) Source/OpenCAGE/Popups/Configuration Editors/AttributesEditor.cs:315— AttributesEditor.Save has cognitive complexity 57 (threshold 15). 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.
AnimationImport.Read (cognitive 57) Source/OpenCAGE/Scripts/AnimationImport.cs:217— AnimationImport.Read has cognitive complexity 57 (threshold 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.
WebSocketPacketLog.FormatSummary (cognitive 57) Source/OpenCAGE/Scripts/Unity Connection/WebSocketPacketLog.cs:26— WebSocketPacketLog.FormatSummary has cognitive complexity 57 (threshold 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.
McpLevelTools.PlayerSetup (cognitive 57) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1831— McpLevelTools.PlayerSetup has cognitive complexity 57 (threshold 15). Most of this is not in the body itself: 4 of the 57 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1843, 1837, 1897). 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.
McpEditorTools.CreateLevel (cognitive 57) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:699— McpEditorTools.CreateLevel has cognitive complexity 57 (threshold 15). Of this number, 52 points are the body's own statements and 5 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.
ModInstaller.Analyze (cognitive 56) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:487— ModInstaller.Analyze has cognitive complexity 56 (threshold 15). Of this number, 54 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.
McpAssetTools.EditTextureTool (cognitive 56) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1767— McpAssetTools.EditTextureTool has cognitive complexity 56 (threshold 15). None of this is in the body itself: all 56 points belong to 7 function literals inside it that branch (lines 1770, 1836, 1842, …). 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.
McpAnimationAssetTools.ListAnimations (cognitive 56) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:949— McpAnimationAssetTools.ListAnimations has cognitive complexity 56 (threshold 15). Most of this is not in the body itself: 2 of the 56 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 960, 1027). 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.
McpResourceTools.PlanCollision (cognitive 56) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1036— McpResourceTools.PlanCollision has cognitive complexity 56 (threshold 15). Of this number, 55 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCameraTools.CreateCameraAnimation (cognitive 56) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:915— McpCameraTools.CreateCameraAnimation has cognitive complexity 56 (threshold 15). Most of this is not in the body itself: 10 of the 56 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 952, 978, 934). 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.
FlowgraphManagerUtils.LinksMatch (cognitive 55) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1119— FlowgraphManagerUtils.LinksMatch has cognitive complexity 55 (threshold 15). 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.
RefactorEdit.AfterChange (cognitive 55) Source/OpenCAGE/Scripts/Undo/RefactorEdit.cs:210— RefactorEdit.AfterChange has cognitive complexity 55 (threshold 15). Of this number, 49 points are the body's own statements and 6 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.
NodeUtils.AlignRelayRows (cognitive 55) Source/OpenCAGE/Scripts/NodeUtils.cs:500— NodeUtils.AlignRelayRows has cognitive complexity 55 (threshold 15). Of this number, 54 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.
McpResourceTools.ImportPhysicsSystem (cognitive 55) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1805— McpResourceTools.ImportPhysicsSystem has cognitive complexity 55 (threshold 15). Most of this is not in the body itself: 13 of the 55 points are its own statements and the rest belongs to one function literal inside it that branches (line 1823). 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.
McpSpatialTools.SampleSpace (cognitive 55) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:865— McpSpatialTools.SampleSpace has cognitive complexity 55 (threshold 15). Of this number, 54 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.
McpSoundTools.LevelSoundPackage (cognitive 55) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:556— McpSoundTools.LevelSoundPackage has cognitive complexity 55 (threshold 15). Of this number, 50 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpUsageTools.GetUsagePatterns (cognitive 55) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:470— McpUsageTools.GetUsagePatterns has cognitive complexity 55 (threshold 15). Of this number, 43 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EditMaterial.materialList_SelectedIndexChanged (cognitive 54) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:612— EditMaterial.materialList_SelectedIndexChanged has cognitive complexity 54 (threshold 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.
LevelSoundOverride.Revert (cognitive 54) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:282— LevelSoundOverride.Revert has cognitive complexity 54 (threshold 15). Of this number, 53 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.
McpAnimationAssetTools.EditBehaviourTree (cognitive 54) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4952— McpAnimationAssetTools.EditBehaviourTree has cognitive complexity 54 (threshold 15). Of this number, 53 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.
McpCageAnimationTools.CallsFromElsewhere (cognitive 54) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1253— McpCageAnimationTools.CallsFromElsewhere has cognitive complexity 54 (threshold 15). Of this number, 53 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.
McpLevelTools.CaptureEnvironmentMaps (cognitive 54) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1429— McpLevelTools.CaptureEnvironmentMaps has cognitive complexity 54 (threshold 15). Of this number, 33 points are the body's own statements and 21 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.
McpValidation.Walk (cognitive 54) Source/OpenCAGE/Scripts/MCP/McpTool.cs:666— McpValidation.Walk has cognitive complexity 54 (threshold 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.
TreeUtility.AddFileToTree (cognitive 53) Source/OpenCAGE/Scripts/TreeUtility.cs:341— TreeUtility.AddFileToTree has cognitive complexity 53 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpGameDataTools.SetXmlRecord (cognitive 53) REDACTED:785— McpGameDataTools.SetXmlRecord has cognitive complexity 53 (threshold 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.
MaterialApplier.GetDiffuseTint (cognitive 52) Source/OpenCAGE/Scripts/MaterialApplier.cs:645— MaterialApplier.GetDiffuseTint has cognitive complexity 52 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCageAnimationTools.ResolveTransformKey (cognitive 52) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2483— McpCageAnimationTools.ResolveTransformKey has cognitive complexity 52 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpEditingTools.CopyEntities (cognitive 52) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:207— McpEditingTools.CopyEntities has cognitive complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 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.
McpEditorTools.SaveLevel (cognitive 52) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1383— McpEditorTools.SaveLevel has cognitive complexity 52 (threshold 15). Of this number, 43 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpPortingTools.PortPlan (cognitive 52) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1002— McpPortingTools.PortPlan has cognitive complexity 52 (threshold 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.
LevelPartDependencies.Reached (cognitive 51) Source/OpenCAGE/Scripts/Modding/LevelPart.cs:75— LevelPartDependencies.Reached has cognitive complexity 51 (threshold 15). Of this number, 50 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.
McpAnimationAssetTools.ExportAnimations (cognitive 51) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1383— McpAnimationAssetTools.ExportAnimations has cognitive complexity 51 (threshold 15). Most of this is not in the body itself: 9 of the 51 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1426, 1463, 1387, …). 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.
McpAnimationAssetTools.DescribeSoundEvent (cognitive 51) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5218— McpAnimationAssetTools.DescribeSoundEvent has cognitive complexity 51 (threshold 15). 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.
McpCageAnimationTools.SetAnimationEvents (cognitive 51) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2979— McpCageAnimationTools.SetAnimationEvents has cognitive complexity 51 (threshold 15). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 2985, 2997, 3055, …). 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.
McpZoneTools.CreateZoneLink (cognitive 51) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2269— McpZoneTools.CreateZoneLink has cognitive complexity 51 (threshold 15). Of this number, 23 points are the body's own statements and 28 belong to 4 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.
McpNames.Score (cognitive 50) Source/OpenCAGE/Scripts/MCP/McpTool.cs:840— McpNames.Score has cognitive complexity 50 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCollision.Bounds (cognitive 50) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:579— McpCollision.Bounds has cognitive complexity 50 (threshold 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.
WwiseSoundBank.ParseDialogueEvent (cognitive 49) Source/OpenCAGE/Scripts/Audio/WwiseSoundBank.cs:379— WwiseSoundBank.ParseDialogueEvent has cognitive complexity 49 (threshold 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.
ModManagerForm.ApplyChanges (cognitive 49) Source/OpenCAGE/Popups/ModManagerForm.cs:1033— ModManagerForm.ApplyChanges has cognitive complexity 49 (threshold 15). Of this number, 48 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.
CompositeDeleteEdit.Apply (cognitive 49) Source/OpenCAGE/Scripts/Undo/CompositeEdits.cs:132— CompositeDeleteEdit.Apply has cognitive complexity 49 (threshold 15). Of this number, 48 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
McpCageAnimationTools.PoseSamples (cognitive 49) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1054— McpCageAnimationTools.PoseSamples has cognitive complexity 49 (threshold 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.
McpEditingTools.DescribePlacement (cognitive 49) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1395— McpEditingTools.DescribePlacement has cognitive complexity 49 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpScript.Describe (cognitive 49) Source/OpenCAGE/Scripts/MCP/McpScript.cs:414— McpScript.Describe has cognitive complexity 49 (threshold 15). Of this number, 47 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.
Geometry.Neighbours (cognitive 49) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:462— Geometry.Neighbours has cognitive complexity 49 (threshold 15). Of this number, 35 points are the body's own statements and 14 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.
WwiseBankBuilder.Borrow (cognitive 48) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:340— WwiseBankBuilder.Borrow has cognitive complexity 48 (threshold 15). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaterialApplier.GetEmissiveTint (cognitive 48) Source/OpenCAGE/Scripts/MaterialApplier.cs:1371— MaterialApplier.GetEmissiveTint has cognitive complexity 48 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
XmlMerge.Match (cognitive 48) REDACTED:264— XmlMerge.Match has cognitive complexity 48 (threshold 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.
ModExporterForm.UpdateSummary (cognitive 48) Source/OpenCAGE/Popups/ModExporterForm.cs:1114— ModExporterForm.UpdateSummary has cognitive complexity 48 (threshold 15). Of this number, 32 points are the body's own statements and 16 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.
McpAnimationAssetTools.ApplyBehaviourOp (cognitive 48) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4883— McpAnimationAssetTools.ApplyBehaviourOp has cognitive complexity 48 (threshold 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.
McpDebugger.Run (cognitive 48) Source/OpenCAGE/Scripts/MCP/McpDebugger.cs:24— McpDebugger.Run has cognitive complexity 48 (threshold 15). Of this number, 23 points are the body's own statements and 25 belong to 3 function literals inside it that branch. 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.
McpPortingTools.PortComposites (cognitive 48) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:509— McpPortingTools.PortComposites has cognitive complexity 48 (threshold 15). Of this number, 23 points are the body's own statements and 25 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.
PhysicsSystemImporter.SetBodyProperties (cognitive 47) Source/OpenCAGE/Scripts/PhysicsSystemImporter.cs:182— PhysicsSystemImporter.SetBodyProperties has cognitive complexity 47 (threshold 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.
McpBrowseTools.GetEffectiveParameters (cognitive 47) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:530— McpBrowseTools.GetEffectiveParameters has cognitive complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 537, 625, 622). 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.
McpScriptEdit.WhyValueIgnored (cognitive 47) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1364— McpScriptEdit.WhyValueIgnored has cognitive complexity 47 (threshold 15). Of this number, 46 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.
McpZoneTools.ZoneIn (cognitive 47) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:638— McpZoneTools.ZoneIn has cognitive complexity 47 (threshold 15). Of this number, 46 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.
AssetUsage.TexturesOnlyUsedBy (cognitive 46) Source/OpenCAGE/Scripts/AssetUsage.cs:163— AssetUsage.TexturesOnlyUsedBy has cognitive complexity 46 (threshold 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.
EditorUtils.GetAllZonesForEntity (cognitive 46) Source/OpenCAGE/Scripts/EditorUtils.cs:999— EditorUtils.GetAllZonesForEntity has cognitive complexity 46 (threshold 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.
Program.Main (cognitive 46) Source/OpenCAGE/Program.cs:32— Program.Main has cognitive complexity 46 (threshold 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.
EntityParameterProxy.BuildProperties (cognitive 46) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:237— EntityParameterProxy.BuildProperties has cognitive complexity 46 (threshold 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.
McpAnimationAssetTools.ResolveField (cognitive 46) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3437— McpAnimationAssetTools.ResolveField has cognitive complexity 46 (threshold 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.
McpCageAnimationTools.EditTrack (cognitive 46) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2636— McpCageAnimationTools.EditTrack has cognitive complexity 46 (threshold 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.
McpMaterialTools.EditMapping (cognitive 46) REDACTED:933— McpMaterialTools.EditMapping has cognitive complexity 46 (threshold 15). Most of this is not in the body itself: 2 of the 46 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 943, 949, 1062). 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.
McpUsageTools.Build (cognitive 46) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:272— McpUsageTools.Build has cognitive complexity 46 (threshold 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.
McpZoneTools.ContentPath (cognitive 46) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:732— McpZoneTools.ContentPath has cognitive complexity 46 (threshold 15). Of this number, 26 points are the body's own statements and 20 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.
ScatterChart::(anonymous)::label (cognitive 46) Source/WebAPI/dashboard_app.js:164— ScatterChart::(anonymous)::label has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 5, ternaries 2 (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.
AnimationTreeGraph.ClearFlowChildReference (cognitive 45) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationTreeGraph.cs:492— AnimationTreeGraph.ClearFlowChildReference has cognitive complexity 45 (threshold 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.
EditMaterial.BuildParameterGroupBox (cognitive 45) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:301— EditMaterial.BuildParameterGroupBox has cognitive complexity 45 (threshold 15). Of this number, 25 points are the body's own statements and 20 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.
McpAnimationAssetTools.DescribeAnimation (cognitive 45) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1059— McpAnimationAssetTools.DescribeAnimation has cognitive complexity 45 (threshold 15). None of this is in the body itself: all 45 points belong to 2 function literals inside it that branch (lines 1068, 1132). 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.
McpCameraTools.Build (cognitive 45) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:405— McpCameraTools.Build has cognitive complexity 45 (threshold 15). Of this number, 23 points are the body's own statements and 22 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AnimTreeCanvas.SetTopPin (cognitive 44) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1194— AnimTreeCanvas.SetTopPin has cognitive complexity 44 (threshold 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.
ThemeEngine.ApplyDark (cognitive 44) Source/OpenCAGE/Scripts/Theming/ThemeEngine.cs:379— ThemeEngine.ApplyDark has cognitive complexity 44 (threshold 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.
KeyedListMerge.Merge (cognitive 44) Source/OpenCAGE/Scripts/Modding/Merging/TextMerge.cs:34— KeyedListMerge.Merge has cognitive complexity 44 (threshold 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.
LevelContent.Save (cognitive 44) Source/OpenCAGE/Scripts/LevelContent.cs:177— LevelContent.Save has cognitive complexity 44 (threshold 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.
LocalDebug.SanityCheckResourceTransformsInternal (cognitive 44) Source/OpenCAGE/Scripts/LocalDebug.cs:580— LocalDebug.SanityCheckResourceTransformsInternal has cognitive complexity 44 (threshold 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.
McpCageAnimationTools.Describe (cognitive 44) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:634— McpCageAnimationTools.Describe has cognitive complexity 44 (threshold 15). Of this number, 43 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.
McpScriptEdit.SetTriggerSequence (cognitive 44) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:702— McpScriptEdit.SetTriggerSequence has cognitive complexity 44 (threshold 15). Of this number, 43 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.
McpSoundTools.BankLoaders (cognitive 44) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:171— McpSoundTools.BankLoaders has cognitive complexity 44 (threshold 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.
CurveEditor.LeftButtonDown (cognitive 43) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2017— CurveEditor.LeftButtonDown has cognitive complexity 43 (threshold 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.
CAGEAnimationEditor.RebuildTrackTree (cognitive 43) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:723— CAGEAnimationEditor.RebuildTrackTree has cognitive complexity 43 (threshold 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.
McpAssetTools.SetModelMaterial (cognitive 43) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:763— McpAssetTools.SetModelMaterial has cognitive complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 769, 838, 791, …). 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.
McpRegion.Resolve (cognitive 43) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:126— McpRegion.Resolve has cognitive complexity 43 (threshold 15). Of this number, 42 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.
BmlPatch.Apply (cognitive 42) REDACTED:219— BmlPatch.Apply has cognitive complexity 42 (threshold 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.
LoadedGameFiles.AfterChange (cognitive 42) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:196— LoadedGameFiles.AfterChange has cognitive complexity 42 (threshold 15). Of this number, 36 points are the body's own statements and 6 belong to 5 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.
CurveEditor.MouseMovedTo (cognitive 42) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2558— CurveEditor.MouseMovedTo has cognitive complexity 42 (threshold 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.
ModelIO.SetSkinnedBounds (cognitive 42) Source/OpenCAGE/Scripts/ModelIO.cs:525— ModelIO.SetSkinnedBounds has cognitive complexity 42 (threshold 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.
ShowCrossRefs.GetEntityRefs (cognitive 42) Source/OpenCAGE/Popups/ShowCrossRefs.cs:254— ShowCrossRefs.GetEntityRefs has cognitive complexity 42 (threshold 15). Of this number, 22 points are the body's own statements and 20 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.
McpAnimationAssetTools.WriteFields (cognitive 42) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3221— McpAnimationAssetTools.WriteFields has cognitive complexity 42 (threshold 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.
McpCageAnimationTools.SetTangents (cognitive 42) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2746— McpCageAnimationTools.SetTangents has cognitive complexity 42 (threshold 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.
McpLevelTools.SetPlayerStart (cognitive 42) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1941— McpLevelTools.SetPlayerStart has cognitive complexity 42 (threshold 15). Most of this is not in the body itself: 13 of the 42 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1956, 1989, 2021). 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.
LiveLinkDebugger.ParseList (cognitive 42) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:1143— LiveLinkDebugger.ParseList has cognitive complexity 42 (threshold 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.
Flowgraph.ContextMenu_Opening (cognitive 41) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1178— Flowgraph.ContextMenu_Opening has cognitive complexity 41 (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.
WwiseBankBuilder.Build (cognitive 41) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:81— WwiseBankBuilder.Build has cognitive complexity 41 (threshold 15). Of this number, 39 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.
MaterialGenerator.FacesPointBothWays (cognitive 41) Source/OpenCAGE/Scripts/MaterialGenerator.cs:411— MaterialGenerator.FacesPointBothWays has cognitive complexity 41 (threshold 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.
TreeUtility.UpdateFileTree (cognitive 41) Source/OpenCAGE/Scripts/TreeUtility.cs:69— TreeUtility.UpdateFileTree has cognitive complexity 41 (threshold 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.
McpGameDataTools.SetVoiceMappings (cognitive 41) REDACTED:1957— McpGameDataTools.SetVoiceMappings has cognitive complexity 41 (threshold 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.
McpDialogs.Sweep (cognitive 41) Source/OpenCAGE/Scripts/MCP/McpEditor.cs:531— McpDialogs.Sweep has cognitive complexity 41 (threshold 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, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Filter.Ok (cognitive 41) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1348— Filter.Ok has cognitive complexity 41 (threshold 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.
McpCollision.Gather (cognitive 41) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:305— McpCollision.Gather has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
LiveLinkCameraSync.Follow (cognitive 41) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:479— LiveLinkCameraSync.Follow has cognitive complexity 41 (threshold 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.
LiveLinkTrace.Step (cognitive 41) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs:376— LiveLinkTrace.Step has cognitive complexity 41 (threshold 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.
CommandsEditor.ApplyAllOptionCheckboxesFromSettings (cognitive 40) Source/OpenCAGE/CommandsEditor.cs:2989— CommandsEditor.ApplyAllOptionCheckboxesFromSettings has cognitive complexity 40 (threshold 15). 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.
LevelSoundOverrideEditor.Read (cognitive 40) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:223— LevelSoundOverrideEditor.Read has cognitive complexity 40 (threshold 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.
ModLevelMerger.Extract (cognitive 40) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:144— ModLevelMerger.Extract has cognitive complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AnimationPakMerge.MergeGlobalClips (cognitive 40) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:407— AnimationPakMerge.MergeGlobalClips has cognitive complexity 40 (threshold 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.
FlowgraphLayoutManager.TrimLayoutsForDeletion (cognitive 40) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:346— FlowgraphLayoutManager.TrimLayoutsForDeletion has cognitive complexity 40 (threshold 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.
Document.BuildSkins (cognitive 40) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:341— Document.BuildSkins has cognitive complexity 40 (threshold 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.
ZoneColours.ZoneColours.ctor (cognitive 40) Source/OpenCAGE/Scripts/ZoneColours.cs:95— ZoneColours.ZoneColours.ctor has cognitive complexity 40 (threshold 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.
SkinnedSubmesh.Build (cognitive 40) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:473— SkinnedSubmesh.Build has cognitive complexity 40 (threshold 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.
EntityParameterProxy.RefreshParameterStatuses (cognitive 40) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:167— EntityParameterProxy.RefreshParameterStatuses has cognitive complexity 40 (threshold 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.
McpCageAnimationTools.ResolveChannel (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2014— McpCageAnimationTools.ResolveChannel has cognitive complexity 40 (threshold 15). Of this number, 39 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.
McpScriptTools.Write (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1264— McpScriptTools.Write has cognitive complexity 40 (threshold 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.
McpViewportTools.Pick (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1662— McpViewportTools.Pick has cognitive complexity 40 (threshold 15). Of this number, 30 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.
Geometry.Tokens (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:706— Geometry.Tokens has cognitive complexity 40 (threshold 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.
McpZoneTools.DeleteZone (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1282— McpZoneTools.DeleteZone has cognitive complexity 40 (threshold 15). Of this number, 37 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.
McpZoneTools.FindDoor (cognitive 40) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1960— McpZoneTools.FindDoor has cognitive complexity 40 (threshold 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.
EditorTables.Absorb (cognitive 39) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:404— EditorTables.Absorb has cognitive complexity 39 (threshold 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.
XmlLayout.Scan (cognitive 39) REDACTED:527— XmlLayout.Scan has cognitive complexity 39 (threshold 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.
Pak2Merge.Merge (cognitive 39) REDACTED:194— Pak2Merge.Merge has cognitive complexity 39 (threshold 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.
EntityDeleteEdit.Revert (cognitive 39) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:319— EntityDeleteEdit.Revert has cognitive complexity 39 (threshold 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.
McpAssetTools.Scope (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:659— McpAssetTools.Scope has cognitive complexity 39 (threshold 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.
McpAssetTools.ExportTextures (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1659— McpAssetTools.ExportTextures has cognitive complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 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.
McpAnimationAssetTools.Coerce (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3534— McpAnimationAssetTools.Coerce has cognitive complexity 39 (threshold 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.
McpAnimationAssetTools.ListSoundBanks (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5140— McpAnimationAssetTools.ListSoundBanks has cognitive complexity 39 (threshold 15). Most of this is not in the body itself: 7 of the 39 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 5152, 5205, 5195). 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.
McpPortingTools.ExportToLevels (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:1079— McpPortingTools.ExportToLevels has cognitive complexity 39 (threshold 15). Of this number, 32 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.
McpScriptTools.Prepare (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:604— McpScriptTools.Prepare has cognitive complexity 39 (threshold 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.
McpResults.Fit (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpTool.cs:1039— McpResults.Fit has cognitive complexity 39 (threshold 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.
McpCameraTools.KeepClear (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:645— McpCameraTools.KeepClear has cognitive complexity 39 (threshold 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.
McpRegion.FindPlaces (cognitive 39) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:609— McpRegion.FindPlaces has cognitive complexity 39 (threshold 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.
CompositeDisplay.CloneClipboardEntities (cognitive 38) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2408— CompositeDisplay.CloneClipboardEntities has cognitive complexity 38 (threshold 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.
Flowgraph.UpdatePinValueTexts (cognitive 38) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.PinValues.cs:113— Flowgraph.UpdatePinValueTexts has cognitive complexity 38 (threshold 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.
McpAnimationAssetTools.DescribeRig (cognitive 38) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1334— McpAnimationAssetTools.DescribeRig has cognitive complexity 38 (threshold 15). Of this number, 36 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.
McpAnimationAssetTools.GetBehaviourTree (cognitive 38) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4759— McpAnimationAssetTools.GetBehaviourTree has cognitive complexity 38 (threshold 15). Of this number, 35 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.
McpGameDataTools.SetRecipe (cognitive 38) REDACTED:1524— McpGameDataTools.SetRecipe has cognitive complexity 38 (threshold 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.
McpGameDataTools.StringsOfEntity (cognitive 38) REDACTED:2136— McpGameDataTools.StringsOfEntity has cognitive complexity 38 (threshold 15). Of this number, 37 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.
Nearest.Query (cognitive 38) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1418— Nearest.Query has cognitive complexity 38 (threshold 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.
McpSoundTools.PlaceSound (cognitive 38) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:374— McpSoundTools.PlaceSound has cognitive complexity 38 (threshold 15). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 398, 436, 464). 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.
AssetUsage.FindMaterialReferences (cognitive 37) Source/OpenCAGE/Scripts/AssetUsage.cs:66— AssetUsage.FindMaterialReferences has cognitive complexity 37 (threshold 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.
McpCageAnimationTools.FindAnimations (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:880— McpCageAnimationTools.FindAnimations has cognitive complexity 37 (threshold 15). None of this is in the body itself: all 37 points belong to 2 function literals inside it that branch (lines 882, 933). 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.
McpEditingTools.ClearInstanceOverrides (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:693— McpEditingTools.ClearInstanceOverrides has cognitive complexity 37 (threshold 15). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 748, 703). 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.
McpImportTools.DescribeImportPlan (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:636— McpImportTools.DescribeImportPlan has cognitive complexity 37 (threshold 15). Of this number, 26 points are the body's own statements and 11 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.
McpPortingTools.SearchLevel (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:139— McpPortingTools.SearchLevel has cognitive complexity 37 (threshold 15). Of this number, 27 points are the body's own statements and 10 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.
McpScript.FindComposite (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpScript.cs:82— McpScript.FindComposite has cognitive complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpScriptEdit.BuildOverrideIndex (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1413— McpScriptEdit.BuildOverrideIndex has cognitive complexity 37 (threshold 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.
McpViewportTools.FreshPreview (cognitive 37) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2466— McpViewportTools.FreshPreview has cognitive complexity 37 (threshold 15). Of this number, 34 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.
EditAnimations.UsersOf (cognitive 36) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:1071— EditAnimations.UsersOf has cognitive complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CompositeBrowser.UpdateFlatListInPlace (cognitive 36) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:828— CompositeBrowser.UpdateFlatListInPlace has cognitive complexity 36 (threshold 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.
InstallScanner.Scan (cognitive 36) Source/OpenCAGE/Scripts/Modding/InstallScanner.cs:81— InstallScanner.Scan has cognitive complexity 36 (threshold 15). Of this number, 34 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.
AnimationPakMerge.MergeSetClips (cognitive 36) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:296— AnimationPakMerge.MergeSetClips has cognitive complexity 36 (threshold 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.
LevelContent.Dispose (cognitive 36) Source/OpenCAGE/Scripts/LevelContent.cs:294— LevelContent.Dispose has cognitive complexity 36 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModelIO.TryReadBones (cognitive 36) Source/OpenCAGE/Scripts/ModelIO.cs:1742— ModelIO.TryReadBones has cognitive complexity 36 (threshold 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.
ModelIO.RescaleSubmeshes (cognitive 36) Source/OpenCAGE/Scripts/ModelIO.cs:1904— ModelIO.RescaleSubmeshes has cognitive complexity 36 (threshold 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.
EntityDeleteEdit.Remove (cognitive 36) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:142— EntityDeleteEdit.Remove has cognitive complexity 36 (threshold 15). Of this number, 33 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.
GlobalEntitySearchHelper.JumpToEntity (cognitive 36) Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:211— GlobalEntitySearchHelper.JumpToEntity has cognitive complexity 36 (threshold 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.
McpCageAnimationTools.AnimateParameters (cognitive 36) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1675— McpCageAnimationTools.AnimateParameters has cognitive complexity 36 (threshold 15). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 1687). 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.
McpGameDataTools.SetAssetSet (cognitive 36) REDACTED:1789— McpGameDataTools.SetAssetSet has cognitive complexity 36 (threshold 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.
McpCharacterTools.Resolve (cognitive 36) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:425— McpCharacterTools.Resolve has cognitive complexity 36 (threshold 15). Of this number, 35 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.
HashCache.HashAll (cognitive 35) Source/OpenCAGE/Scripts/Modding/HashCache.cs:124— HashCache.HashAll has cognitive complexity 35 (threshold 15). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 168). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
ModelIO.BuildCS2 (cognitive 35) Source/OpenCAGE/Scripts/ModelIO.cs:1330— ModelIO.BuildCS2 has cognitive complexity 35 (threshold 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.
EditModel.RebuildModelFileTree (cognitive 35) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:147— EditModel.RebuildModelFileTree has cognitive complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpAssetTools.DescribeModel (cognitive 35) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:324— McpAssetTools.DescribeModel has cognitive complexity 35 (threshold 15). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 330, 384). 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.
McpAssetTools.SetGalaxy (cognitive 35) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2087— McpAssetTools.SetGalaxy has cognitive complexity 35 (threshold 15). Of this number, 31 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.
McpEditorTools.DuplicateLevel (cognitive 35) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:937— McpEditorTools.DuplicateLevel has cognitive complexity 35 (threshold 15). Of this number, 32 points are the body's own statements and 3 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.
dashboard_app.ScatterChart (cognitive 35) Source/WebAPI/dashboard_app.js:92— dashboard_app.ScatterChart has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (13 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 96, 217, 221, …). 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.
CommandsEditor.SaveLevelCore (cognitive 34) Source/OpenCAGE/CommandsEditor.cs:1897— CommandsEditor.SaveLevelCore has cognitive complexity 34 (threshold 15). 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.
SelectEnumString.PopulateItems (cognitive 34) Source/OpenCAGE/Popups/SelectEnumString.cs:168— SelectEnumString.PopulateItems has cognitive complexity 34 (threshold 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.
SoundImport.Shape (cognitive 34) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:148— SoundImport.Shape has cognitive complexity 34 (threshold 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.
EditorTables.CombinePages (cognitive 34) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:481— EditorTables.CombinePages has cognitive complexity 34 (threshold 15). Of this number, 32 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.
ModelIO.ToSubmesh (cognitive 34) Source/OpenCAGE/Scripts/ModelIO.cs:1568— ModelIO.ToSubmesh has cognitive complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
AnimationRetarget.Retarget (cognitive 34) Source/OpenCAGE/Scripts/AnimationRetarget.cs:705— AnimationRetarget.Retarget has cognitive complexity 34 (threshold 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.
McpCageAnimationTools.MatchEvents (cognitive 34) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3279— McpCageAnimationTools.MatchEvents has cognitive complexity 34 (threshold 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.
McpMaterialTools.DescribeMaterial (cognitive 34) REDACTED:223— McpMaterialTools.DescribeMaterial has cognitive complexity 34 (threshold 15). Of this number, 32 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.
McpUsageTools.Report (cognitive 34) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:593— McpUsageTools.Report has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpZoneTools.AreaComposite (cognitive 34) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2660— McpZoneTools.AreaComposite has cognitive complexity 34 (threshold 15). Of this number, 18 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.
McpZoneTools.DoorProblems (cognitive 34) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:753— McpZoneTools.DoorProblems has cognitive complexity 34 (threshold 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.
Flowgraph.ShowFlowgraph (cognitive 33) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:828— Flowgraph.ShowFlowgraph has cognitive complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WwiseMediaInjector.ReplaceInBank (cognitive 33) Source/OpenCAGE/Scripts/Audio/WwiseMediaInjector.cs:284— WwiseMediaInjector.ReplaceInBank has cognitive complexity 33 (threshold 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.
XmlMerge.MergeChildren (cognitive 33) REDACTED:110— XmlMerge.MergeChildren has cognitive complexity 33 (threshold 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.
McpBrowseTools.DescribeFunctionType (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1505— McpBrowseTools.DescribeFunctionType has cognitive complexity 33 (threshold 15). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1509, 1529). 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.
McpViewportTools.Capture (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:425— McpViewportTools.Capture has cognitive complexity 33 (threshold 15). Of this number, 18 points are the body's own statements and 15 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.
McpViewportTools.Place (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2294— McpViewportTools.Place has cognitive complexity 33 (threshold 15). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 2308, 2354, 2365, …). 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.
Geometry.ComputePartition (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:624— Geometry.ComputePartition has cognitive complexity 33 (threshold 15). Of this number, 25 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpCharacterTools.MainCharacter (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:120— McpCharacterTools.MainCharacter has cognitive complexity 33 (threshold 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.
McpZoneTools.UnitsIn (cognitive 33) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:827— McpZoneTools.UnitsIn has cognitive complexity 33 (threshold 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.
CompositeBrowser.BuildFolderList (cognitive 32) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:754— CompositeBrowser.BuildFolderList has cognitive complexity 32 (threshold 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.
LevelTextDBEditor.levelList_SelectedIndexChanged (cognitive 32) REDACTED:115— LevelTextDBEditor.levelList_SelectedIndexChanged has cognitive complexity 32 (threshold 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.
CompositeTree.Rebuild (cognitive 32) Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:354— CompositeTree.Rebuild has cognitive complexity 32 (threshold 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.
ModState.Load (cognitive 32) Source/OpenCAGE/Scripts/Modding/ModState.cs:96— ModState.Load has cognitive complexity 32 (threshold 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.
PakParts.PutLine (cognitive 32) Source/OpenCAGE/Scripts/Modding/PakParts.cs:497— PakParts.PutLine has cognitive complexity 32 (threshold 15). Of this number, 30 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.
EditorUtils.CloseAI (cognitive 32) Source/OpenCAGE/Scripts/EditorUtils.cs:566— EditorUtils.CloseAI has cognitive complexity 32 (threshold 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.
McpAnimationAssetTools.ListBlendSets (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2805— McpAnimationAssetTools.ListBlendSets has cognitive complexity 32 (threshold 15). None of this is in the body itself: all 32 points belong to 2 function literals inside it that branch (lines 2810, 2868). 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.
McpLevelTools.EditorOptions (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:799— McpLevelTools.EditorOptions has cognitive complexity 32 (threshold 15). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 831). 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.
McpEditorTools.DiffLevel (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1150— McpEditorTools.DiffLevel has cognitive complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpPlatformTools.Decorate (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:300— McpPlatformTools.Decorate has cognitive complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 329, 346, 321). 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.
McpSoundTools.PlayedBy (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:268— McpSoundTools.PlayedBy has cognitive complexity 32 (threshold 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.
McpSoundTools.ListDialogueLines (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:302— McpSoundTools.ListDialogueLines has cognitive complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 308, 348, 341, …). 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.
McpSoundTools.FindSpareSoundEvents (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpSoundTools.cs:497— McpSoundTools.FindSpareSoundEvents has cognitive complexity 32 (threshold 15). Of this number, 20 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpCharacterTools.DescribeNpcTool (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1361— McpCharacterTools.DescribeNpcTool has cognitive complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1372, 1395, 1397). 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.
McpZoneTools.ChangeContents (cognitive 32) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1127— McpZoneTools.ChangeContents has cognitive complexity 32 (threshold 15). Of this number, 30 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.
AnimTreeCanvas.ApplyDrawnLink (cognitive 31) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1046— AnimTreeCanvas.ApplyDrawnLink has cognitive complexity 31 (threshold 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.
InventoryItemEditor.Save (cognitive 31) Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:237— InventoryItemEditor.Save has cognitive complexity 31 (threshold 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.
LaunchGame.ApplyRuntimeUtils (cognitive 31) Source/OpenCAGE/Popups/LaunchGame.cs:393— LaunchGame.ApplyRuntimeUtils has cognitive complexity 31 (threshold 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.
WaveFile.Read (cognitive 31) Source/OpenCAGE/Scripts/Audio/WaveFile.cs:54— WaveFile.Read has cognitive complexity 31 (threshold 15). 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.
ModInstaller.BuildPlan (cognitive 31) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:332— ModInstaller.BuildPlan has cognitive complexity 31 (threshold 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.
CompositePreviewManager.ApplyCaptureResults (cognitive 31) Source/OpenCAGE/Scripts/CompositePreviewManager.cs:849— CompositePreviewManager.ApplyCaptureResults has cognitive complexity 31 (threshold 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.
McpAssets.ResourcesOf (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2687— McpAssets.ResourcesOf has cognitive complexity 31 (threshold 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.
McpAnimationAssetTools.SetTreeField (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3597— McpAnimationAssetTools.SetTreeField has cognitive complexity 31 (threshold 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.
McpAnimationAssetTools.CollectHits (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3889— McpAnimationAssetTools.CollectHits has cognitive complexity 31 (threshold 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.
McpGlobalAssetChecks.AnimationProblems (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5724— McpGlobalAssetChecks.AnimationProblems has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
McpResourceTools.Effective (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:492— McpResourceTools.Effective has cognitive complexity 31 (threshold 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.
McpEditorTools.ReadImports (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2111— McpEditorTools.ReadImports has cognitive complexity 31 (threshold 15). Of this number, 27 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.
McpPortingTools.DescribeLevelComposite (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:440— McpPortingTools.DescribeLevelComposite has cognitive complexity 31 (threshold 15). Of this number, 25 points are the body's own statements and 6 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.
McpScriptEdit.RenameOnPages (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:950— McpScriptEdit.RenameOnPages has cognitive complexity 31 (threshold 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.
McpScriptEdit.Delete (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:987— McpScriptEdit.Delete has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Connection.CallTool (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpServer.cs:519— Connection.CallTool has cognitive complexity 31 (threshold 15). Of this number, 24 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.
McpViewportTools.DescribePick (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1783— McpViewportTools.DescribePick has cognitive complexity 31 (threshold 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.
McpSpatialTools.Grid (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1365— McpSpatialTools.Grid has cognitive complexity 31 (threshold 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.
McpSpatialTools.TransformPoints (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1477— McpSpatialTools.TransformPoints has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpZoneTools.CreateZone (cognitive 31) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:932— McpZoneTools.CreateZone has cognitive complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 971, 948, 954, …). 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.
LiveLinkCameraSync.Step (cognitive 31) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkCamera.cs:352— LiveLinkCameraSync.Step has cognitive complexity 31 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AnimTreeCanvas.ArrangeAll (cognitive 30) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:649— AnimTreeCanvas.ArrangeAll has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalisationHandler.RefreshLoadedStrings (cognitive 30) Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:315— LocalisationHandler.RefreshLoadedStrings has cognitive complexity 30 (threshold 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.
ThemeEngine.Restore (cognitive 30) Source/OpenCAGE/Scripts/Theming/ThemeEngine.cs:776— ThemeEngine.Restore has cognitive complexity 30 (threshold 15). 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.
MaterialApplier.CompositeDirtOntoDiffuse (cognitive 30) Source/OpenCAGE/Scripts/MaterialApplier.cs:434— MaterialApplier.CompositeDirtOntoDiffuse has cognitive complexity 30 (threshold 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.
CollisionProxyImporter.FromModelFile (cognitive 30) Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:54— CollisionProxyImporter.FromModelFile has cognitive complexity 30 (threshold 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.
EnumStringPopupEditor.EditValue (cognitive 30) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridDescriptors.cs:871— EnumStringPopupEditor.EditValue has cognitive complexity 30 (threshold 15). Of this number, 20 points are the body's own statements and 10 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.
ViewerEntitySync.AliasesWithReasonToStay (cognitive 30) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:336— ViewerEntitySync.AliasesWithReasonToStay has cognitive complexity 30 (threshold 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.
McpAssetTools.ExportModel (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:443— McpAssetTools.ExportModel has cognitive complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 459). 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.
McpAnimationAssetTools.CheckTreeClips (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3950— McpAnimationAssetTools.CheckTreeClips has cognitive complexity 30 (threshold 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.
McpGameDataTools.ResetConfigsTool (cognitive 30) REDACTED:2926— McpGameDataTools.ResetConfigsTool has cognitive complexity 30 (threshold 15). Of this number, 26 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.
McpLevelTools.DescribeActivity (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1306— McpLevelTools.DescribeActivity has cognitive complexity 30 (threshold 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.
McpResourceTools.AllReferences (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:400— McpResourceTools.AllReferences has cognitive complexity 30 (threshold 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.
McpResourceTools.ResolveCharacter (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2070— McpResourceTools.ResolveCharacter has cognitive complexity 30 (threshold 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.
McpImportTools.Tools (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:24— McpImportTools.Tools has cognitive complexity 30 (threshold 15). None of this is in the body itself: all 30 points belong to 6 function literals inside it that branch (lines 180, 146, 125, …). 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.
McpImportTools.FinishImport (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:554— McpImportTools.FinishImport has cognitive complexity 30 (threshold 15). Of this number, 17 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.
McpViewportTools.GetState (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:579— McpViewportTools.GetState has cognitive complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 583). 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.
McpViewportTools.SetCamera (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1139— McpViewportTools.SetCamera has cognitive complexity 30 (threshold 15). 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.
McpLightTools.Describe (cognitive 30) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:382— McpLightTools.Describe has cognitive complexity 30 (threshold 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.
Flowgraph.RefreshActivityBadges (cognitive 29) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:171— Flowgraph.RefreshActivityBadges has cognitive complexity 29 (threshold 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.
Flowgraph.PageLinks (cognitive 29) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:264— Flowgraph.PageLinks has cognitive complexity 29 (threshold 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.
EnvironmentMapCapture.Use (cognitive 29) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:622— EnvironmentMapCapture.Use has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BmlPatch.DiffElement (cognitive 29) REDACTED:118— BmlPatch.DiffElement has cognitive complexity 29 (threshold 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.
ModExporterForm.Export (cognitive 29) Source/OpenCAGE/Popups/ModExporterForm.cs:1315— ModExporterForm.Export has cognitive complexity 29 (threshold 15). Of this number, 15 points are the body's own statements and 14 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.
BuildFingerprint.Of (cognitive 29) Source/OpenCAGE/Scripts/BuildFingerprint.cs:71— BuildFingerprint.Of has cognitive complexity 29 (threshold 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.
AnimationPakWrite.PrepareTrees (cognitive 29) Source/OpenCAGE/Scripts/AnimationPakWrite.cs:125— AnimationPakWrite.PrepareTrees has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FbxBinary.WriteProperty (cognitive 29) Source/OpenCAGE/Scripts/ModelExport/FbxDocument.cs:126— FbxBinary.WriteProperty has cognitive complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 5 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.
ListViewGroupNavigation.OnKeyDown (cognitive 29) Source/OpenCAGE/Scripts/ListViewGroupNavigation.cs:45— ListViewGroupNavigation.OnKeyDown has cognitive complexity 29 (threshold 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.
McpCageAnimationTools.PreviewInGame (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3784— McpCageAnimationTools.PreviewInGame has cognitive complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpPlacements.WalkIn (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:2135— McpPlacements.WalkIn has cognitive complexity 29 (threshold 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.
McpPageTools.FindNode (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:699— McpPageTools.FindNode has cognitive complexity 29 (threshold 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.
McpResourceTools.SetRenderable (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:734— McpResourceTools.SetRenderable has cognitive complexity 29 (threshold 15). None of this is in the body itself: all 29 points belong to 4 function literals inside it that branch (lines 736, 755, 784, …). 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.
McpResourceTools.ApplyAttributes (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2501— McpResourceTools.ApplyAttributes has cognitive complexity 29 (threshold 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.
McpScriptEdit.Run (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:110— McpScriptEdit.Run has cognitive complexity 29 (threshold 15). None of this is in the body itself: all 29 points belong to 4 function literals inside it that branch (lines 114, 142, 166, …). 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.
McpViewportTools.ResolveLookThrough (cognitive 29) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1348— McpViewportTools.ResolveLookThrough has cognitive complexity 29 (threshold 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.
ViewerParameterSync.ApplyCore (cognitive 29) Source/OpenCAGE/Scripts/Unity Connection/ViewerParameterSync.cs:225— ViewerParameterSync.ApplyCore has cognitive complexity 29 (threshold 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.
Singleton.ListAnimations (cognitive 29) Source/OpenCAGE/Scripts/Singleton.cs:267— Singleton.ListAnimations has cognitive complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 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.
Program.Handle (cognitive 29) Source/OpenCAGE.MCP/Program.cs:276— Program.Handle has cognitive complexity 29 (threshold 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.
CommandsEditor.ApplySettingEffects (cognitive 28) Source/OpenCAGE/CommandsEditor.cs:3089— CommandsEditor.ApplySettingEffects has cognitive complexity 28 (threshold 15). 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.
EntityInspector.DescribeStoredPath (cognitive 28) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1794— EntityInspector.DescribeStoredPath has cognitive complexity 28 (threshold 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.
Flowgraph.ProcessCmdKey (cognitive 28) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:964— Flowgraph.ProcessCmdKey has cognitive complexity 28 (threshold 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.
AlienConfigEditor.Save (cognitive 28) Source/OpenCAGE/Popups/Configuration Editors/AlienConfigEditor.cs:100— AlienConfigEditor.Save has cognitive complexity 28 (threshold 15). 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.
LaunchGame.PdbPath (cognitive 28) Source/OpenCAGE/Popups/LaunchGame.cs:551— LaunchGame.PdbPath has cognitive complexity 28 (threshold 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.
AlienLevel.RestoreBackup (cognitive 28) Source/OpenCAGE/Scripts/AlienLevel.cs:354— AlienLevel.RestoreBackup has cognitive complexity 28 (threshold 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.
WwiseBankBuilder.Reachable (cognitive 28) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:190— WwiseBankBuilder.Reachable has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModInstaller.CheckFile (cognitive 28) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:705— ModInstaller.CheckFile has cognitive complexity 28 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Writer.Pairs (cognitive 28) REDACTED:665— Writer.Pairs has cognitive complexity 28 (threshold 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.
CurveEditor.LeftButtonUp (cognitive 28) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2686— CurveEditor.LeftButtonUp has cognitive complexity 28 (threshold 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.
CathodeLibExtensions.ExportMesh (cognitive 28) Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:539— CathodeLibExtensions.ExportMesh has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelIO.BuildAnimation (cognitive 28) Source/OpenCAGE/Scripts/ModelIO.cs:612— ModelIO.BuildAnimation has cognitive complexity 28 (threshold 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.
LocalDebug.CheckAnimKFTypes (cognitive 28) Source/OpenCAGE/Scripts/LocalDebug.cs:40— LocalDebug.CheckAnimKFTypes has cognitive complexity 28 (threshold 15). 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.
McpAnimationAssetTools.Catalogue (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4736— McpAnimationAssetTools.Catalogue has cognitive complexity 28 (threshold 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.
McpCageAnimationTools.DescribeFloatTrack (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:739— McpCageAnimationTools.DescribeFloatTrack has cognitive complexity 28 (threshold 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.
McpGameDataTools.SetPlaylist (cognitive 28) REDACTED:1423— McpGameDataTools.SetPlaylist has cognitive complexity 28 (threshold 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.
McpPortingTools.PlanPlacement (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:748— McpPortingTools.PlanPlacement has cognitive complexity 28 (threshold 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.
McpScriptEdit.SetParameter (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1158— McpScriptEdit.SetParameter has cognitive complexity 28 (threshold 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.
McpRegion.ResolveZone (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:228— McpRegion.ResolveZone has cognitive complexity 28 (threshold 15). Of this number, 24 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.
McpZoneTools.GetZoneLinks (cognitive 28) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:523— McpZoneTools.GetZoneLinks has cognitive complexity 28 (threshold 15). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 527). 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.
AnimationSkeletonPicker.Score (cognitive 27) Source/OpenCAGE/Popups/Resource Editors/AnimationSkeletonPicker.cs:123— AnimationSkeletonPicker.Score has cognitive complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 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.
Flowgraph.RefreshDebugMarks (cognitive 27) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:177— Flowgraph.RefreshDebugMarks has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositeArchive.Extract (cognitive 27) Source/OpenCAGE/Scripts/CompositeArchive.cs:426— CompositeArchive.Extract has cognitive complexity 27 (threshold 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.
SoundImport.Layout (cognitive 27) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:82— SoundImport.Layout has cognitive complexity 27 (threshold 15). 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.
MaterialApplier.ApplyMaterial (cognitive 27) Source/OpenCAGE/Scripts/MaterialApplier.cs:250— MaterialApplier.ApplyMaterial has cognitive complexity 27 (threshold 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.
ShaderDatabase.Build (cognitive 27) Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:424— ShaderDatabase.Build has cognitive complexity 27 (threshold 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.
CompositePreviewImages.Refresh (cognitive 27) Source/OpenCAGE/Scripts/CompositePreviewImages.cs:271— CompositePreviewImages.Refresh has cognitive complexity 27 (threshold 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.
CurveEditor.BuildContextMenu (cognitive 27) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1880— CurveEditor.BuildContextMenu has cognitive complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RefactorEdit.Apply (cognitive 27) Source/OpenCAGE/Scripts/Undo/RefactorEdit.cs:72— RefactorEdit.Apply has cognitive complexity 27 (threshold 15). 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.
CageAnimationDrivers.FindCompositesReachingAnAnimation (cognitive 27) Source/OpenCAGE/Scripts/CAGE Animation/CageAnimationDrivers.cs:97— CageAnimationDrivers.FindCompositesReachingAnAnimation has cognitive complexity 27 (threshold 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.
ParameterGridPanel.ResetParam_Click (cognitive 27) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:1233— ParameterGridPanel.ResetParam_Click has cognitive complexity 27 (threshold 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.
SettingsManager.SaveOnce (cognitive 27) Source/OpenCAGE/Scripts/SettingsManager.cs:486— SettingsManager.SaveOnce has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewerClipboardSync.ApplyCore (cognitive 27) Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:43— ViewerClipboardSync.ApplyCore has cognitive complexity 27 (threshold 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.
McpAnimationAssetTools.FindInTrees (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3866— McpAnimationAssetTools.FindInTrees has cognitive complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 3876). 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.
McpCageAnimationTools.ReadTransformKey (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2154— McpCageAnimationTools.ReadTransformKey has cognitive complexity 27 (threshold 15). 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.
McpCageAnimationTools.AddEvent (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3221— McpCageAnimationTools.AddEvent has cognitive complexity 27 (threshold 15). Of this number, 25 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.
McpEditingTools.DeleteComposites (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1121— McpEditingTools.DeleteComposites has cognitive complexity 27 (threshold 15). Of this number, 25 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.
McpLevelTools.Animate (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1610— McpLevelTools.Animate has cognitive complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
McpResourceTools.GetEntityResources (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:421— McpResourceTools.GetEntityResources has cognitive complexity 27 (threshold 15). None of this is in the body itself: all 27 points belong to one function literal inside it that branches (line 423). 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.
McpResourceTools.ListPhysicsSystems (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1755— McpResourceTools.ListPhysicsSystems has cognitive complexity 27 (threshold 15). None of this is in the body itself: all 27 points belong to 3 function literals inside it that branch (lines 1757, 1788, 1794). 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.
McpResourceTools.GetCharacterAppearance (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:2195— McpResourceTools.GetCharacterAppearance has cognitive complexity 27 (threshold 15). None of this is in the body itself: all 27 points belong to one function literal inside it that branches (line 2197). 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.
McpEditorTools.State (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:496— McpEditorTools.State has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpScriptEdit.GiveNodes (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1543— McpScriptEdit.GiveNodes has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpScriptTools.NoteUnzoned (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2122— McpScriptTools.NoteUnzoned has cognitive complexity 27 (threshold 15). Of this number, 24 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.
McpSchema.StripDeprecated (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpTool.cs:492— McpSchema.StripDeprecated has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpCameraTools.CheckPath (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:700— McpCameraTools.CheckPath has cognitive complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpRegion.ResolveComposite (cognitive 27) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:285— McpRegion.ResolveComposite has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveLinkDebugger.Poll (cognitive 27) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:799— LiveLinkDebugger.Poll has cognitive complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.Main (cognitive 27) Source/OpenCAGE.MCP/Program.cs:88— Program.Main has cognitive complexity 27 (threshold 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.
AnimTreeCanvas.CanDraw (cognitive 26) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:974— AnimTreeCanvas.CanDraw has cognitive complexity 26 (threshold 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.
CompositeDisplay.ApplyViewerSelectionPath (cognitive 26) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1110— CompositeDisplay.ApplyViewerSelectionPath has cognitive complexity 26 (threshold 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.
DifficultyEditor.SaveAlienConfig (cognitive 26) Source/OpenCAGE/Popups/Configuration Editors/DifficultyEditor.cs:225— DifficultyEditor.SaveAlienConfig has cognitive complexity 26 (threshold 15). 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.
MaterialGenerator.TryNearestPermutation (cognitive 26) Source/OpenCAGE/Scripts/MaterialGenerator.cs:778— MaterialGenerator.TryNearestPermutation has cognitive complexity 26 (threshold 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.
ModExportBuilder.Write (cognitive 26) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:346— ModExportBuilder.Write has cognitive complexity 26 (threshold 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.
LevelContent.GenerateListViewItem (cognitive 26) Source/OpenCAGE/Scripts/LevelContent.cs:426— LevelContent.GenerateListViewItem has cognitive complexity 26 (threshold 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.
CAGEAnimationEditor.ConfirmRemovingStringEvents (cognitive 26) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.AnimationMode.cs:777— CAGEAnimationEditor.ConfirmRemovingStringEvents has cognitive complexity 26 (threshold 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.
GUI_SplineViewer.ShowSpline (cognitive 26) Source/OpenCAGE/Popups/UserControls/GUI_SplineViewer.xaml.cs:45— GUI_SplineViewer.ShowSpline has cognitive complexity 26 (threshold 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.
CathodeLibExtensions.ForceStringNumeric (cognitive 26) Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:650— CathodeLibExtensions.ForceStringNumeric has cognitive complexity 26 (threshold 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.
ModelIO.CreateImportPlan (cognitive 26) Source/OpenCAGE/Scripts/ModelIO.cs:1150— ModelIO.CreateImportPlan has cognitive complexity 26 (threshold 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.
VertexSource.Get (cognitive 26) Source/OpenCAGE/Scripts/ModelIO.cs:2246— VertexSource.Get has cognitive complexity 26 (threshold 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.
EditorUtils.ForceStringNumeric (cognitive 26) Source/OpenCAGE/Scripts/EditorUtils.cs:453— EditorUtils.ForceStringNumeric has cognitive complexity 26 (threshold 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.
SkinnedSubmesh.Pose (cognitive 26) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:559— SkinnedSubmesh.Pose has cognitive complexity 26 (threshold 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.
ParameterGridPanel.CopyParameterValue (cognitive 26) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:612— ParameterGridPanel.CopyParameterValue has cognitive complexity 26 (threshold 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.
McpAssetTools.ExportModels (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:513— McpAssetTools.ExportModels has cognitive complexity 26 (threshold 15). Of this number, 19 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.
McpGlobalAssetChecks.Suggest (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5606— McpGlobalAssetChecks.Suggest has cognitive complexity 26 (threshold 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.
McpEditingTools.GetPlacements (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1197— McpEditingTools.GetPlacements has cognitive complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 1205). 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.
McpMaterialTools.CreateMaterial (cognitive 26) REDACTED:425— McpMaterialTools.CreateMaterial has cognitive complexity 26 (threshold 15). None of this is in the body itself: all 26 points belong to 5 function literals inside it that branch (lines 429, 470, 475, …). 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.
McpPageTools.AddNodes (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:800— McpPageTools.AddNodes has cognitive complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpScriptTools.StepRemoveParameters (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1586— McpScriptTools.StepRemoveParameters has cognitive complexity 26 (threshold 15). Of this number, 25 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.
McpScriptTools.Batch (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2011— McpScriptTools.Batch has cognitive complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpSpatialTools.ExportRegionCollision (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1760— McpSpatialTools.ExportRegionCollision has cognitive 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, 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.
McpCameraTools.AnimateCameraPath (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:814— McpCameraTools.AnimateCameraPath has cognitive complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 839, 824). 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.
McpUsageTools.Example (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:692— McpUsageTools.Example has cognitive complexity 26 (threshold 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.
McpRegion.Score (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:540— McpRegion.Score has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpZoneTools.DescribeLink (cognitive 26) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:463— McpZoneTools.DescribeLink has cognitive complexity 26 (threshold 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.
EditAnimationMetadata.PutSetting (cognitive 25) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:633— EditAnimationMetadata.PutSetting has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
CompositeBrowser.FileTree_MouseDown (cognitive 25) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1675— CompositeBrowser.FileTree_MouseDown has cognitive complexity 25 (threshold 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.
Flowgraph.deleteToolStripMenuItem_Click (cognitive 25) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1555— Flowgraph.deleteToolStripMenuItem_Click has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlienLevel.RestoreSome (cognitive 25) Source/OpenCAGE/Scripts/AlienLevel.cs:515— AlienLevel.RestoreSome has cognitive complexity 25 (threshold 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.
SoundEventMetadata.Lookup (cognitive 25) Source/OpenCAGE/Scripts/Audio/SoundEventMetadata.cs:94— SoundEventMetadata.Lookup has cognitive complexity 25 (threshold 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.
ModInstaller.RewriteEverywhere (cognitive 25) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1059— ModInstaller.RewriteEverywhere has cognitive complexity 25 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Writer.Element (cognitive 25) REDACTED:604— Writer.Element has cognitive complexity 25 (threshold 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.
PhysicsSystemImporter.Import (cognitive 25) Source/OpenCAGE/Scripts/PhysicsSystemImporter.cs:127— PhysicsSystemImporter.Import has cognitive complexity 25 (threshold 15). 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.
CurveEditor.UpdateHover (cognitive 25) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2470— CurveEditor.UpdateHover has cognitive complexity 25 (threshold 15). 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.
LocalDebug.CheckWriteInstanced (cognitive 25) Source/OpenCAGE/Scripts/LocalDebug.cs:124— LocalDebug.CheckWriteInstanced has cognitive complexity 25 (threshold 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.
ModelEditor.RefreshSelectedModelPreview (cognitive 25) Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:327— ModelEditor.RefreshSelectedModelPreview has cognitive complexity 25 (threshold 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.
GUI_AnimationViewer.Refresh (cognitive 25) Source/OpenCAGE/Popups/Resource Editors/GUI_AnimationViewer.xaml.cs:314— GUI_AnimationViewer.Refresh has cognitive complexity 25 (threshold 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.
ViewerSelectionSync.ApplyCore (cognitive 25) Source/OpenCAGE/Scripts/Unity Connection/ViewerSelectionSync.cs:114— ViewerSelectionSync.ApplyCore has cognitive complexity 25 (threshold 15). 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.
McpMaterialTools.ListMappings (cognitive 25) REDACTED:880— McpMaterialTools.ListMappings has cognitive complexity 25 (threshold 15). None of this is in the body itself: all 25 points belong to 3 function literals inside it that branch (lines 882, 909, 890). 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.
McpEditorTools.DeleteLevel (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1044— McpEditorTools.DeleteLevel has cognitive complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 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.
McpPortingTools.SourceAppearances (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:916— McpPortingTools.SourceAppearances has cognitive complexity 25 (threshold 15). Of this number, 21 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.
McpValues.DescribePin (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpScript.cs:962— McpValues.DescribePin has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
McpServer.Serve (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpServer.cs:116— McpServer.Serve has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Connection.Receive (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpServer.cs:351— Connection.Receive has cognitive complexity 25 (threshold 15). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Geometry.Pairs (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1493— Geometry.Pairs has cognitive complexity 25 (threshold 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.
McpCameraTools.Slopes (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:521— McpCameraTools.Slopes has cognitive complexity 25 (threshold 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.
McpValueSource.Of (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1125— McpValueSource.Of has cognitive complexity 25 (threshold 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.
McpZoneTools.LinksOfZone (cognitive 25) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:569— McpZoneTools.LinksOfZone has cognitive complexity 25 (threshold 15). Of this number, 22 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.
LiveLink.DataLinkPins (cognitive 25) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:396— LiveLink.DataLinkPins has cognitive complexity 25 (threshold 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.
LiveLinkDebugger.SendKept (cognitive 25) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:935— LiveLinkDebugger.SendKept has cognitive complexity 25 (threshold 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.
Program.SendLoop (cognitive 25) Source/OpenCAGE.MCP/Program.cs:404— Program.SendLoop has cognitive complexity 25 (threshold 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.
EditAnimations.FillClips (cognitive 24) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:553— EditAnimations.FillClips has cognitive complexity 24 (threshold 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.
CompositeDisplay.IsEntityStillReferenced (cognitive 24) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2071— CompositeDisplay.IsEntityStillReferenced has cognitive complexity 24 (threshold 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.
AmmoEditor.Save (cognitive 24) Source/OpenCAGE/Popups/Configuration Editors/AmmoEditor.cs:204— AmmoEditor.Save has cognitive complexity 24 (threshold 15). 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.
WwiseCodebooks.Rebuild (cognitive 24) Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:92— WwiseCodebooks.Rebuild has cognitive complexity 24 (threshold 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.
WwiseVorbisWriter.Build (cognitive 24) Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:59— WwiseVorbisWriter.Build has cognitive complexity 24 (threshold 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.
SoundSeekBar.OnPaint (cognitive 24) Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:958— SoundSeekBar.OnPaint has cognitive complexity 24 (threshold 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.
ModExportBuilder.Summarise (cognitive 24) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:411— ModExportBuilder.Summarise has cognitive complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 5 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.
LineMerge.Lcs (cognitive 24) Source/OpenCAGE/Scripts/Modding/Merging/TextMerge.cs:310— LineMerge.Lcs has cognitive complexity 24 (threshold 15). 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.
FlowgraphManagerUtils.AsFlowgraphMeta (cognitive 24) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:1037— FlowgraphManagerUtils.AsFlowgraphMeta has cognitive complexity 24 (threshold 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.
CollisionProxyImporter.Import (cognitive 24) Source/OpenCAGE/Scripts/CollisionProxyImporter.cs:200— CollisionProxyImporter.Import has cognitive complexity 24 (threshold 15). 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.
Document.BuildMesh (cognitive 24) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:192— Document.BuildMesh has cognitive complexity 24 (threshold 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.
EntityDeleteEdit.Prune (cognitive 24) Source/OpenCAGE/Scripts/Undo/EntityEdits.cs:239— EntityDeleteEdit.Prune has cognitive complexity 24 (threshold 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.
NodeUtils.CollectTriggerSequenceMethods (cognitive 24) Source/OpenCAGE/Scripts/NodeUtils.cs:31— NodeUtils.CollectTriggerSequenceMethods has cognitive complexity 24 (threshold 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.
ParameterGridPanel.PropagateMultiEdits (cognitive 24) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:562— ParameterGridPanel.PropagateMultiEdits has cognitive complexity 24 (threshold 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.
McpAnimationAssetTools.CheckAnimations (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2675— McpAnimationAssetTools.CheckAnimations has cognitive complexity 24 (threshold 15). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 2679). 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.
McpAnimationAssetTools.UnlinkField (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3733— McpAnimationAssetTools.UnlinkField has cognitive complexity 24 (threshold 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.
McpAnimationAssetTools.ApplyTreeOp (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3769— McpAnimationAssetTools.ApplyTreeOp has cognitive complexity 24 (threshold 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.
McpGameDataTools.ListStrings (cognitive 24) REDACTED:2079— McpGameDataTools.ListStrings has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpSpatialTools.FindPlaces (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:376— McpSpatialTools.FindPlaces has cognitive complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 385). 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.
McpZoneTools.ApplyMove (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:1784— McpZoneTools.ApplyMove has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpZoneTools.LinkZones (cognitive 24) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:403— McpZoneTools.LinkZones has cognitive 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, 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.
CompositeDisplay.CreateVariableEntityCore (cognitive 23) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:3209— CompositeDisplay.CreateVariableEntityCore has cognitive complexity 23 (threshold 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.
CompositeArchive.ExportedWith (cognitive 23) Source/OpenCAGE/Scripts/CompositeArchive.cs:64— CompositeArchive.ExportedWith has cognitive complexity 23 (threshold 15). None of this is in the body itself: all 23 points belong to 2 function literals inside it that branch (lines 68, 87). 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.
AlienLevel.PathsOf (cognitive 23) Source/OpenCAGE/Scripts/AlienLevel.cs:260— AlienLevel.PathsOf has cognitive complexity 23 (threshold 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.
WwiseMediaInjector.PatchSourceRecords (cognitive 23) Source/OpenCAGE/Scripts/Audio/WwiseMediaInjector.cs:411— WwiseMediaInjector.PatchSourceRecords has cognitive complexity 23 (threshold 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.
ModInstaller.NewFileCheck (cognitive 23) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:660— ModInstaller.NewFileCheck has cognitive complexity 23 (threshold 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.
ModInstaller.ResolveChecked (cognitive 23) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:772— ModInstaller.ResolveChecked has cognitive complexity 23 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (ModInstaller.Resolve) 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.
ModInstaller.Resolve (cognitive 23) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2045— ModInstaller.Resolve has cognitive complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 2063). 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (ModInstaller.ResolveChecked) 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.
MergeConflict.Place (cognitive 23) Source/OpenCAGE/Scripts/Modding/Merging/MergeCore.cs:45— MergeConflict.Place has cognitive complexity 23 (threshold 15). 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.
AnimTreeLayoutsMerge.Into (cognitive 23) REDACTED:385— AnimTreeLayoutsMerge.Into has cognitive complexity 23 (threshold 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.
CAGEAnimationEditor.TrackTree_NodeMouseClick (cognitive 23) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:424— CAGEAnimationEditor.TrackTree_NodeMouseClick has cognitive complexity 23 (threshold 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.
ModelIO.ToAssimpMesh (cognitive 23) Source/OpenCAGE/Scripts/ModelIO.cs:994— ModelIO.ToAssimpMesh has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModelIO.ResolveVertexNumbering (cognitive 23) Source/OpenCAGE/Scripts/ModelIO.cs:1832— ModelIO.ResolveVertexNumbering has cognitive complexity 23 (threshold 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.
ModelImportRig.ScoreFit (cognitive 23) Source/OpenCAGE/Scripts/ModelImportRig.cs:145— ModelImportRig.ScoreFit has cognitive complexity 23 (threshold 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.
EntityParameterProxy.CreateDescriptor (cognitive 23) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:455— EntityParameterProxy.CreateDescriptor has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ViewerZoneSync.ResolveZoneMembers (cognitive 23) Source/OpenCAGE/Scripts/Unity Connection/ViewerZoneSync.cs:256— ViewerZoneSync.ResolveZoneMembers has cognitive complexity 23 (threshold 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.
McpAnimationAssetTools.RemoveAnimation (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1883— McpAnimationAssetTools.RemoveAnimation has cognitive 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 2 function literals inside it that branch (lines 1895, 1934). 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.
McpCageAnimationTools.RemoveTracks (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2848— McpCageAnimationTools.RemoveTracks has cognitive complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 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.
McpCageAnimationTools.UpdateEvent (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3363— McpCageAnimationTools.UpdateEvent has cognitive complexity 23 (threshold 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.
Step.Resolve (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1884— Step.Resolve has cognitive complexity 23 (threshold 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.
McpMaterialTools.ListMaterials (cognitive 23) REDACTED:178— McpMaterialTools.ListMaterials has cognitive complexity 23 (threshold 15). None of this is in the body itself: all 23 points belong to 7 function literals inside it that branch (lines 180, 205, 201, …). 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.
McpEditorTools.Step (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2337— McpEditorTools.Step has cognitive complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 2345). 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.
McpPortingTools.DisplayModelsFor (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:707— McpPortingTools.DisplayModelsFor has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpScriptTools.Aim (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1121— McpScriptTools.Aim has cognitive complexity 23 (threshold 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.
McpSpatialTools.FreeCentre (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:1057— McpSpatialTools.FreeCentre has cognitive complexity 23 (threshold 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.
McpCollision.AddModelCollider (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:435— McpCollision.AddModelCollider has cognitive complexity 23 (threshold 15). 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.
McpCollision.Build (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:880— McpCollision.Build has cognitive complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 891). 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.
McpZoneTools.OutsideContent (cognitive 23) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:2621— McpZoneTools.OutsideContent has cognitive 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 2634). 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.
LiveLink.ParseAnimation (cognitive 23) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLink.cs:834— LiveLink.ParseAnimation has cognitive complexity 23 (threshold 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.
EditAnimationMetadata.PutEntry (cognitive 22) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:544— EditAnimationMetadata.PutEntry has cognitive complexity 22 (threshold 15). 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.
EditBlendSets.FillUsers (cognitive 22) Source/OpenCAGE/Popups/Resource Editors/EditBlendSets.cs:353— EditBlendSets.FillUsers has cognitive complexity 22 (threshold 15). 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.
EditAnimations.FillSets (cognitive 22) Source/OpenCAGE/Popups/Resource Editors/EditAnimations.cs:381— EditAnimations.FillSets has cognitive complexity 22 (threshold 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.
LevelBackupManager.backupAllNow_Click (cognitive 22) Source/OpenCAGE/Popups/LevelBackupManager.cs:364— LevelBackupManager.backupAllNow_Click has cognitive complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 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.
EnvironmentMapCapture.Placements (cognitive 22) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:175— EnvironmentMapCapture.Placements has cognitive complexity 22 (threshold 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.
Node.Parse (cognitive 22) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:520— Node.Parse has cognitive complexity 22 (threshold 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.
MaterialApplier.ApplySpecularChannelsToDiffuse (cognitive 22) Source/OpenCAGE/Scripts/MaterialApplier.cs:985— MaterialApplier.ApplySpecularChannelsToDiffuse has cognitive complexity 22 (threshold 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.
ModInstaller.ComposeFile (cognitive 22) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2145— ModInstaller.ComposeFile has cognitive complexity 22 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ModLevelMerger.Merge (cognitive 22) Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:45— ModLevelMerger.Merge has cognitive complexity 22 (threshold 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.
CurveEditor.ToggleSelected (cognitive 22) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:2233— CurveEditor.ToggleSelected has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AnimationImport.ApplyRoot (cognitive 22) Source/OpenCAGE/Scripts/AnimationImport.cs:427— AnimationImport.ApplyRoot has cognitive complexity 22 (threshold 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.
AnimationImport.BoneFor (cognitive 22) Source/OpenCAGE/Scripts/AnimationImport.cs:603— AnimationImport.BoneFor has cognitive complexity 22 (threshold 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.
ModelImportRig.Examine (cognitive 22) Source/OpenCAGE/Scripts/ModelImportRig.cs:81— ModelImportRig.Examine has cognitive complexity 22 (threshold 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.
EntityParameterVisibility.IsHiddenFromEditor (cognitive 22) Source/OpenCAGE/Scripts/EntityParameterVisibility.cs:13— EntityParameterVisibility.IsHiddenFromEditor has cognitive complexity 22 (threshold 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.
EditModel.ApplyImportedRig (cognitive 22) Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:372— EditModel.ApplyImportedRig has cognitive complexity 22 (threshold 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.
AccessorySetRemap.Capture (cognitive 22) Source/OpenCAGE/Scripts/CompositeRefactoring.cs:338— AccessorySetRemap.Capture has cognitive complexity 22 (threshold 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.
McpAnimationAssetTools.ClipIndexes (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1557— McpAnimationAssetTools.ClipIndexes has cognitive complexity 22 (threshold 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.
McpAnimationAssetTools.CollectLinks (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3278— McpAnimationAssetTools.CollectLinks has cognitive complexity 22 (threshold 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.
McpAnimationAssetTools.EditAnimTree (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3988— McpAnimationAssetTools.EditAnimTree has cognitive complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4003, 4055). 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.
McpCageAnimationTools.ClampTangents (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:2811— McpCageAnimationTools.ClampTangents has cognitive complexity 22 (threshold 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.
McpCageAnimationTools.ApplyBindings (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3165— McpCageAnimationTools.ApplyBindings has cognitive complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpPlacements.Reaching (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:2253— McpPlacements.Reaching has cognitive complexity 22 (threshold 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.
McpGameDataTools.SetPhysicalMaterials (cognitive 22) REDACTED:1684— McpGameDataTools.SetPhysicalMaterials has cognitive complexity 22 (threshold 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.
McpResourceTools.DescribeRenderable (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:597— McpResourceTools.DescribeRenderable has cognitive complexity 22 (threshold 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.
McpResourceTools.SetCollision (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:936— McpResourceTools.SetCollision has cognitive complexity 22 (threshold 15). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 938, 955). 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.
McpBrowseTools.Tools (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:27— McpBrowseTools.Tools has cognitive complexity 22 (threshold 15). None of this is in the body itself: all 22 points belong to 3 function literals inside it that branch (lines 197, 249, 255). 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.
IndexGraph.IndexGraph.ctor (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs:237— IndexGraph.IndexGraph.ctor has cognitive complexity 22 (threshold 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.
McpScriptEdit.BuildPages (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1501— McpScriptEdit.BuildPages has cognitive complexity 22 (threshold 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.
McpNavTools.Path (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpNavTools.cs:249— McpNavTools.Path has cognitive complexity 22 (threshold 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.
McpCharacterTools.FindNpcs (cognitive 22) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:300— McpCharacterTools.FindNpcs has cognitive complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 320, 326, 331). 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.
Program.LaunchOrWait (cognitive 22) Source/OpenCAGE.MCP/Program.cs:505— Program.LaunchOrWait has cognitive complexity 22 (threshold 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.
Program.PumpFromEditor (cognitive 22) Source/OpenCAGE.MCP/Program.cs:638— Program.PumpFromEditor has cognitive complexity 22 (threshold 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.
AnimTreeCanvas.Measure (cognitive 21) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:754— AnimTreeCanvas.Measure has cognitive complexity 21 (threshold 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.
Flowgraph.Measure (cognitive 21) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:136— Flowgraph.Measure has cognitive complexity 21 (threshold 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.
InventoryItemEditor.listView_SelectedIndexChanged (cognitive 21) Source/OpenCAGE/Popups/Configuration Editors/InventoryItemEditor.cs:108— InventoryItemEditor.listView_SelectedIndexChanged has cognitive complexity 21 (threshold 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.
ImportCompositeArchive.ImportIntoLevelsOnDisk (cognitive 21) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:413— ImportCompositeArchive.ImportIntoLevelsOnDisk has cognitive complexity 21 (threshold 15). 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.
PackageHandover.ServeLoop (cognitive 21) Source/OpenCAGE/Scripts/PackageHandover.cs:223— PackageHandover.ServeLoop has cognitive complexity 21 (threshold 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.
WwiseFilePackageBuilder.Save (cognitive 21) Source/OpenCAGE/Scripts/Audio/WwiseFilePackageBuilder.cs:175— WwiseFilePackageBuilder.Save has cognitive complexity 21 (threshold 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.
WwiseMediaInjector.PatchSource (cognitive 21) Source/OpenCAGE/Scripts/Audio/WwiseMediaInjector.cs:466— WwiseMediaInjector.PatchSource has cognitive complexity 21 (threshold 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.
SoundImport.Conform (cognitive 21) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:546— SoundImport.Conform has cognitive complexity 21 (threshold 15). 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.
MaterialGenerator.Describe (cognitive 21) Source/OpenCAGE/Scripts/MaterialGenerator.cs:204— MaterialGenerator.Describe has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LevelTextBlocks.WithBlocks (cognitive 21) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:700— LevelTextBlocks.WithBlocks has cognitive complexity 21 (threshold 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.
LayoutTrim.RestoreInto (cognitive 21) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:217— LayoutTrim.RestoreInto has cognitive complexity 21 (threshold 15). Of this number, 18 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.
Document.BuildNode (cognitive 21) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:432— Document.BuildNode has cognitive complexity 21 (threshold 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.
ModelIO.AddBones (cognitive 21) Source/OpenCAGE/Scripts/ModelIO.cs:717— ModelIO.AddBones has cognitive complexity 21 (threshold 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.
EditorUtils.CompositePointsAt (cognitive 21) Source/OpenCAGE/Scripts/EditorUtils.cs:887— EditorUtils.CompositePointsAt has cognitive complexity 21 (threshold 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.
CageAnimationCurves.ValueAt (cognitive 21) Source/OpenCAGE/Scripts/CAGE Animation/CageAnimationCurves.cs:78— CageAnimationCurves.ValueAt has cognitive complexity 21 (threshold 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.
EntityParameterProxy.BuildAliasParameterList (cognitive 21) Source/OpenCAGE/Scripts/ParameterGrid/EntityParameterProxy.cs:416— EntityParameterProxy.BuildAliasParameterList has cognitive complexity 21 (threshold 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.
Send.GeneratePacket (cognitive 21) Source/OpenCAGE/Scripts/Unity Connection/Send.cs:1039— Send.GeneratePacket has cognitive complexity 21 (threshold 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.
McpAnimationAssetTools.DrawnJson (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4205— McpAnimationAssetTools.DrawnJson has cognitive complexity 21 (threshold 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.
Working.Commit (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:1535— Working.Commit has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
McpGameDataTools.GetXmlRecord (cognitive 21) REDACTED:713— McpGameDataTools.GetXmlRecord has cognitive complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 722, 747, 764). 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.
McpLevelTools.GameDirectories (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:610— McpLevelTools.GameDirectories has cognitive complexity 21 (threshold 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.
McpPageTools.MoveNodes (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:866— McpPageTools.MoveNodes has cognitive complexity 21 (threshold 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.
McpTool.Invoke (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpTool.cs:72— McpTool.Invoke has cognitive complexity 21 (threshold 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.
McpCameraTools.Hermite (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:548— McpCameraTools.Hermite has cognitive complexity 21 (threshold 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.
McpLightTools.BehaviourOf (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:280— McpLightTools.BehaviourOf has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpRegion.Index (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpRegion.cs:717— McpRegion.Index has cognitive complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 738). 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.
McpZoneTools.SideLabel (cognitive 21) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:571— McpZoneTools.SideLabel has cognitive complexity 21 (threshold 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.
LiveLinkAnimationDrive.Step (cognitive 21) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:296— LiveLinkAnimationDrive.Step has cognitive complexity 21 (threshold 15). 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.
ScriptErrorLog.Poll (cognitive 21) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkErrors.cs:201— ScriptErrorLog.Poll has cognitive complexity 21 (threshold 15). 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.
EditAnimationMetadata.Save (cognitive 20) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:744— EditAnimationMetadata.Save has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
EntityInspector.CleanupCageAnimationZeroDelayStringParams (cognitive 20) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1852— EntityInspector.CleanupCageAnimationZeroDelayStringParams has cognitive complexity 20 (threshold 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.
Flowgraph.PasteClipboardReferencesCore (cognitive 20) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1923— Flowgraph.PasteClipboardReferencesCore has cognitive complexity 20 (threshold 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.
Flowgraph.SplitNode (cognitive 20) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:179— Flowgraph.SplitNode has cognitive complexity 20 (threshold 15). Of this number, 17 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.
GraphicsEditor.ApplyToDocument (cognitive 20) Source/OpenCAGE/Popups/Configuration Editors/GraphicsEditor.cs:322— GraphicsEditor.ApplyToDocument has cognitive complexity 20 (threshold 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.
ImportComposites.ImportComposites.ctor (cognitive 20) Source/OpenCAGE/Popups/ImportComposites.cs:43— ImportComposites.ImportComposites.ctor has cognitive complexity 20 (threshold 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.
CompositePreviewPane.OnPaint (cognitive 20) Source/OpenCAGE/Popups/UserControls/CompositePreviewPane.cs:151— CompositePreviewPane.OnPaint has cognitive complexity 20 (threshold 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.
GenerateMaterial.ShowPlan (cognitive 20) Source/OpenCAGE/Popups/Resource Editors/GenerateMaterial.cs:103— GenerateMaterial.ShowPlan has cognitive complexity 20 (threshold 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.
AlienLevel.DeleteBackup (cognitive 20) Source/OpenCAGE/Scripts/AlienLevel.cs:651— AlienLevel.DeleteBackup has cognitive complexity 20 (threshold 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.
EnvironmentMapCapture.TryWorldPosition (cognitive 20) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:114— EnvironmentMapCapture.TryWorldPosition has cognitive complexity 20 (threshold 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.
WwiseCodebooks.CopyCodebook (cognitive 20) Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:248— WwiseCodebooks.CopyCodebook has cognitive complexity 20 (threshold 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.
LevelSoundOverride.Finish (cognitive 20) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:676— LevelSoundOverride.Finish has cognitive complexity 20 (threshold 15). 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.
WwiseVorbisConverter.CopyMapping (cognitive 20) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:363— WwiseVorbisConverter.CopyMapping has cognitive complexity 20 (threshold 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.
ThemeManager.SetDark (cognitive 20) Source/OpenCAGE/Scripts/Theming/ThemeManager.cs:398— ThemeManager.SetDark has cognitive complexity 20 (threshold 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.
MaterialApplier.GetShaderColorParameter (cognitive 20) Source/OpenCAGE/Scripts/MaterialApplier.cs:807— MaterialApplier.GetShaderColorParameter has cognitive complexity 20 (threshold 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.
MaterialConsistency.Check (cognitive 20) Source/OpenCAGE/Scripts/MaterialConsistency.cs:80— MaterialConsistency.Check has cognitive complexity 20 (threshold 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.
MaterialGenerator.SameSize (cognitive 20) Source/OpenCAGE/Scripts/MaterialGenerator.cs:536— MaterialGenerator.SameSize has cognitive complexity 20 (threshold 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.
ModExportBuilder.Include (cognitive 20) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:186— ModExportBuilder.Include has cognitive complexity 20 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ConfigDiff.Inherited (cognitive 20) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:905— ConfigDiff.Inherited has cognitive complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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.
XmlMerge.MergeAttributes (cognitive 20) REDACTED:90— XmlMerge.MergeAttributes has cognitive complexity 20 (threshold 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.
ModExporterForm.AddLevelRows (cognitive 20) Source/OpenCAGE/Popups/ModExporterForm.cs:779— ModExporterForm.AddLevelRows has cognitive complexity 20 (threshold 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.
ModExporterForm.RefreshTicks (cognitive 20) Source/OpenCAGE/Popups/ModExporterForm.cs:965— ModExporterForm.RefreshTicks has cognitive complexity 20 (threshold 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.
FlowgraphLayoutManager.TrimToComposite (cognitive 20) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:571— FlowgraphLayoutManager.TrimToComposite has cognitive complexity 20 (threshold 15). Of this number, 18 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.
CurveEditor.FitToTracks (cognitive 20) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:412— CurveEditor.FitToTracks has cognitive complexity 20 (threshold 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.
CurveEditor.ApplyEventVisual (cognitive 20) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1332— CurveEditor.ApplyEventVisual has cognitive complexity 20 (threshold 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.
ModelIO.MeshPiece (cognitive 20) Source/OpenCAGE/Scripts/ModelIO.cs:1529— ModelIO.MeshPiece has cognitive complexity 20 (threshold 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.
VertexSource.VertexSource.ctor (cognitive 20) Source/OpenCAGE/Scripts/ModelIO.cs:2130— VertexSource.VertexSource.ctor has cognitive complexity 20 (threshold 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.
ListViewGroupNavigation.MoveTo (cognitive 20) Source/OpenCAGE/Scripts/ListViewGroupNavigation.cs:154— ListViewGroupNavigation.MoveTo has cognitive complexity 20 (threshold 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.
ViewerResourceSync.Sync (cognitive 20) Source/OpenCAGE/Scripts/Unity Connection/ViewerResourceSync.cs:304— ViewerResourceSync.Sync has cognitive complexity 20 (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.
McpAssetTools.DescribeTexture (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:1376— McpAssetTools.DescribeTexture has cognitive complexity 20 (threshold 15). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 1378). 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.
McpAssets.BuildPlacementCounts (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2583— McpAssets.BuildPlacementCounts has cognitive complexity 20 (threshold 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.
McpAnimationAssetTools.ListCameraClips (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2714— McpAnimationAssetTools.ListCameraClips has cognitive complexity 20 (threshold 15). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 2718). 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.
McpCageAnimationTools.DrivenBy (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:985— McpCageAnimationTools.DrivenBy has cognitive complexity 20 (threshold 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.
McpGameDataTools.LoadForElements (cognitive 20) REDACTED:2622— McpGameDataTools.LoadForElements has cognitive complexity 20 (threshold 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.
McpMaterialTools.Bind (cognitive 20) REDACTED:737— McpMaterialTools.Bind has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpResourceTools.ImportCollisionProxy (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1516— McpResourceTools.ImportCollisionProxy has cognitive complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1531). 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.
McpImportTools.ImportPackageOnDisk (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:1026— McpImportTools.ImportPackageOnDisk has cognitive complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 belong to 5 function literals inside it that branch. 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.
McpEffective.AliasesOf (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpScript.cs:669— McpEffective.AliasesOf has cognitive complexity 20 (threshold 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.
McpScriptTools.StepRemoveLinks (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1798— McpScriptTools.StepRemoveLinks has cognitive complexity 20 (threshold 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.
Filter.Filter.ctor (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.Geometry.cs:1317— Filter.Filter.ctor has cognitive complexity 20 (threshold 15). 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.
McpPlatformTools.Group (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:242— McpPlatformTools.Group has cognitive complexity 20 (threshold 15). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 246). 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.
McpCameraTools.Measure (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpCameraTools.cs:565— McpCameraTools.Measure has cognitive complexity 20 (threshold 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.
McpCharacterTools.AliasesOf (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:398— McpCharacterTools.AliasesOf has cognitive complexity 20 (threshold 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.
McpCharacterTools.SetNpcTool (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:1502— McpCharacterTools.SetNpcTool has cognitive complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpZoneTools.DescribeSide (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:401— McpZoneTools.DescribeSide has cognitive complexity 20 (threshold 15). 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.
McpZoneTools.ReadLinkOptions (cognitive 20) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:365— McpZoneTools.ReadLinkOptions has cognitive complexity 20 (threshold 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.
index.extract_crash_info (cognitive 20) Source/WebAPI/crashes/index.php:16— index.extract_crash_info has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
dashboard_api.getPopularityData (cognitive 20) Source/WebAPI/dashboard_api.php:262— dashboard_api.getPopularityData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (8 pts), 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.
BlendSpaceView.DrawInstances (cognitive 19) Source/OpenCAGE/Popups/UserControls/BlendSpaceView.cs:238— BlendSpaceView.DrawInstances has cognitive complexity 19 (threshold 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.
AnimTreeCanvas.SetFlowChild (cognitive 19) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1141— AnimTreeCanvas.SetFlowChild has cognitive complexity 19 (threshold 15). 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.
CompositeDisplay.LoadEntities (cognitive 19) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1873— CompositeDisplay.LoadEntities has cognitive complexity 19 (threshold 15). Of this number, 12 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.
EntityInspector.PopulateUI (cognitive 19) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:319— EntityInspector.PopulateUI has cognitive complexity 19 (threshold 15). 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.
EntityInspector.editFunction_Click (cognitive 19) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1696— EntityInspector.editFunction_Click has cognitive complexity 19 (threshold 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.
Flowgraph.ArrangeNodes (cognitive 19) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:45— Flowgraph.ArrangeNodes has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebuggerNodeEditor.OnPaint (cognitive 19) Source/OpenCAGE/DockPanels/Composite Panels/DebuggerNodeEditor.cs:59— DebuggerNodeEditor.OnPaint has cognitive complexity 19 (threshold 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.
ExportComposite.export_Click (cognitive 19) Source/OpenCAGE/Popups/ExportComposite.cs:58— ExportComposite.export_Click has cognitive complexity 19 (threshold 15). Of this number, 16 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.
CompositeImporter.Import (cognitive 19) Source/OpenCAGE/Scripts/CompositeImporter.cs:164— CompositeImporter.Import has cognitive complexity 19 (threshold 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.
EnvironmentMapCapture.LevelTargets (cognitive 19) Source/OpenCAGE/Scripts/Textures/EnvironmentMapCapture.cs:499— EnvironmentMapCapture.LevelTargets has cognitive complexity 19 (threshold 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.
LevelSoundOverride.Add (cognitive 19) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:401— LevelSoundOverride.Add has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LevelSoundOverride.SetLevelEvents (cognitive 19) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:595— LevelSoundOverride.SetLevelEvents has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WwiseVorbisConverter.CopyFloor (cognitive 19) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:268— WwiseVorbisConverter.CopyFloor has cognitive complexity 19 (threshold 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.
WwiseVorbisConverter.WriteAudio (cognitive 19) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:421— WwiseVorbisConverter.WriteAudio has cognitive complexity 19 (threshold 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.
WwiseBankBuilder.FindTemplate (cognitive 19) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:290— WwiseBankBuilder.FindTemplate has cognitive complexity 19 (threshold 15). Of this number, 17 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.
ModInstaller.ComposeLevel (cognitive 19) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2206— ModInstaller.ComposeLevel has cognitive complexity 19 (threshold 15). 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.
LineMerge.Diff3 (cognitive 19) Source/OpenCAGE/Scripts/Modding/Merging/TextMerge.cs:258— LineMerge.Diff3 has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnimationPakMerge.MergeTrees (cognitive 19) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:214— AnimationPakMerge.MergeTrees has cognitive complexity 19 (threshold 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.
ModManagerForm.ShowScanSummary (cognitive 19) Source/OpenCAGE/Popups/ModManagerForm.cs:402— ModManagerForm.ShowScanSummary has cognitive complexity 19 (threshold 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.
ModExporterForm.SelectedFiles (cognitive 19) Source/OpenCAGE/Popups/ModExporterForm.cs:1192— ModExporterForm.SelectedFiles has cognitive complexity 19 (threshold 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.
AnimTreeLayoutManager.Rekey (cognitive 19) Source/OpenCAGE/Scripts/AnimTreeLayoutManager.cs:176— AnimTreeLayoutManager.Rekey has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
LoadedGameFiles.WindowsHolding (cognitive 19) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:342— LoadedGameFiles.WindowsHolding has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorIcons.ForEntity (cognitive 19) Source/OpenCAGE/Scripts/EditorIcons.cs:542— EditorIcons.ForEntity has cognitive complexity 19 (threshold 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.
LevelContent.DEBUG_LoadUnthreadedAndPopulateShortGuids (cognitive 19) Source/OpenCAGE/Scripts/LevelContent.cs:364— LevelContent.DEBUG_LoadUnthreadedAndPopulateShortGuids has cognitive complexity 19 (threshold 15). 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.
CurveEditor.DrawCurves (cognitive 19) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1386— CurveEditor.DrawCurves has cognitive complexity 19 (threshold 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.
Document.BuildAnimations (cognitive 19) Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs:554— Document.BuildAnimations has cognitive complexity 19 (threshold 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.
ModelIO.PlacementWarning (cognitive 19) Source/OpenCAGE/Scripts/ModelIO.cs:1246— ModelIO.PlacementWarning has cognitive complexity 19 (threshold 15). 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.
CompositeInstanceParameters.Ensure (cognitive 19) Source/OpenCAGE/Scripts/CompositeInstanceParameters.cs:21— CompositeInstanceParameters.Ensure has cognitive complexity 19 (threshold 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.
EditorUtils.FindZonesForEntity (cognitive 19) Source/OpenCAGE/Scripts/EditorUtils.cs:936— EditorUtils.FindZonesForEntity has cognitive complexity 19 (threshold 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.
ModelEditor.SelectedSubmeshes (cognitive 19) Source/OpenCAGE/Popups/Resource Editors/ModelEditor.cs:90— ModelEditor.SelectedSubmeshes has cognitive complexity 19 (threshold 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.
AnimationModeSession.TryStoredPathFor (cognitive 19) Source/OpenCAGE/Scripts/CAGE Animation/AnimationModeSession.cs:467— AnimationModeSession.TryStoredPathFor has cognitive complexity 19 (threshold 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.
McpAnimationAssetTools.LinkField (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3694— McpAnimationAssetTools.LinkField has cognitive complexity 19 (threshold 15). 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.
McpGlobalAssetChecks.GeometryRig (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5802— McpGlobalAssetChecks.GeometryRig has cognitive complexity 19 (threshold 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.
McpGameDataTools.EditorsFor (cognitive 19) REDACTED:221— McpGameDataTools.EditorsFor has cognitive complexity 19 (threshold 15). 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.
McpGameDataTools.SetSoundbanks (cognitive 19) REDACTED:1618— McpGameDataTools.SetSoundbanks has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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.
McpResourceTools.Resolve (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:304— McpResourceTools.Resolve has cognitive 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpEditorTools.LevelArgument (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1797— McpEditorTools.LevelArgument has cognitive complexity 19 (threshold 15). 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.
McpValueSource.FirstVariable (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpLightTools.cs:1263— McpValueSource.FirstVariable has cognitive complexity 19 (threshold 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.
McpUsageTools.ReadLevels (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpUsageTools.cs:439— McpUsageTools.ReadLevels has cognitive complexity 19 (threshold 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.
McpZoneTools.DescribeAction (cognitive 19) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Plan.cs:349— McpZoneTools.DescribeAction has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CommandsEditor.recaptureAllCubemapsToolStripMenuItem_Click (cognitive 18) Source/OpenCAGE/CommandsEditor.cs:813— CommandsEditor.recaptureAllCubemapsToolStripMenuItem_Click has cognitive 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, 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.
CommandsEditor.TryBuildLevelPanelsWhenReady (cognitive 18) Source/OpenCAGE/CommandsEditor.cs:1352— CommandsEditor.TryBuildLevelPanelsWhenReady has cognitive complexity 18 (threshold 15). Of this number, 15 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.
EditAnimationMetadata.Parse (cognitive 18) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:687— EditAnimationMetadata.Parse has cognitive complexity 18 (threshold 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.
AnimationNodeProxy.AddMember (cognitive 18) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:103— AnimationNodeProxy.AddMember has cognitive complexity 18 (threshold 15). 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.
CompositeDisplay.RefreshNodeMarkers (cognitive 18) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2153— CompositeDisplay.RefreshNodeMarkers has cognitive complexity 18 (threshold 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.
CompositeBrowser.SelectCompositeInListView (cognitive 18) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1346— CompositeBrowser.SelectCompositeInListView has cognitive complexity 18 (threshold 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.
Flowgraph.OnLiveLinkActivityChanged (cognitive 18) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:292— Flowgraph.OnLiveLinkActivityChanged has cognitive complexity 18 (threshold 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.
LevelSoundOverrideEditor.RemoveSelected (cognitive 18) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:489— LevelSoundOverrideEditor.RemoveSelected has cognitive complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LevelSoundBankDialog.AddEvent (cognitive 18) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:325— LevelSoundBankDialog.AddEvent has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
WavePlayer.Queue (cognitive 18) Source/OpenCAGE/Scripts/Audio/WavePlayer.cs:319— WavePlayer.Queue has cognitive complexity 18 (threshold 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.
SoundImport.Encode (cognitive 18) Source/OpenCAGE/Scripts/Audio/SoundImport.cs:351— SoundImport.Encode has cognitive complexity 18 (threshold 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.
ModExportBuilder.AddContent (cognitive 18) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:582— ModExportBuilder.AddContent has cognitive complexity 18 (threshold 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ModInstaller.CaptureVanillaBaselinesLocked (cognitive 18) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1372— ModInstaller.CaptureVanillaBaselinesLocked has cognitive complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TreeVersions.Records (cognitive 18) REDACTED:504— TreeVersions.Records has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModManagerForm.OnFirstShown (cognitive 18) Source/OpenCAGE/Popups/ModManagerForm.cs:207— ModManagerForm.OnFirstShown has cognitive complexity 18 (threshold 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.
ModManagerForm.UpdatePending (cognitive 18) Source/OpenCAGE/Popups/ModManagerForm.cs:527— ModManagerForm.UpdatePending has cognitive complexity 18 (threshold 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.
FlowgraphLayoutManager.OneLevelsPages (cognitive 18) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:677— FlowgraphLayoutManager.OneLevelsPages has cognitive complexity 18 (threshold 15). Of this number, 16 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.
AnimTreeLayoutManager.Commit (cognitive 18) Source/OpenCAGE/Scripts/AnimTreeLayoutManager.cs:230— AnimTreeLayoutManager.Commit has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositePreviewImages.EnsurePreviewList (cognitive 18) Source/OpenCAGE/Scripts/CompositePreviewImages.cs:46— CompositePreviewImages.EnsurePreviewList has cognitive complexity 18 (threshold 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.
CurveEditor.Canvas_MouseWheel (cognitive 18) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1758— CurveEditor.Canvas_MouseWheel has cognitive complexity 18 (threshold 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.
Document.BuildGeometry (cognitive 18) Source/OpenCAGE/Scripts/ModelExport/FbxExporter.cs:320— Document.BuildGeometry has cognitive complexity 18 (threshold 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.
ModelIO.ShareGridAtSeams (cognitive 18) Source/OpenCAGE/Scripts/ModelIO.cs:2045— ModelIO.ShareGridAtSeams has cognitive complexity 18 (threshold 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.
ResourceSessionEdit.ReferencesEqual (cognitive 18) Source/OpenCAGE/Scripts/Undo/SessionEdits.cs:293— ResourceSessionEdit.ReferencesEqual has cognitive complexity 18 (threshold 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.
GlobalEntitySearchHelper.TryFindCompositeInstancePath (cognitive 18) Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:477— GlobalEntitySearchHelper.TryFindCompositeInstancePath has cognitive complexity 18 (threshold 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.
ModelImportPreview.ExecuteGeneratedPlans (cognitive 18) Source/OpenCAGE/Popups/Resource Editors/ModelImportPreview.cs:720— ModelImportPreview.ExecuteGeneratedPlans has cognitive complexity 18 (threshold 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.
TreeUtility.MatchNode (cognitive 18) Source/OpenCAGE/Scripts/TreeUtility.cs:257— TreeUtility.MatchNode has cognitive complexity 18 (threshold 15). 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.
McpAnimationAssetTools.RigsForClips (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:1194— McpAnimationAssetTools.RigsForClips has cognitive complexity 18 (threshold 15). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpAnimationAssetTools.PreviewAnimation (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:2141— McpAnimationAssetTools.PreviewAnimation has cognitive complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2160). 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.
McpEditingTools.MoveComposites (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1037— McpEditingTools.MoveComposites has cognitive complexity 18 (threshold 15). 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.
McpMaterialTools.ListPermutations (cognitive 18) REDACTED:802— McpMaterialTools.ListPermutations has cognitive complexity 18 (threshold 15). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 804, 855, 849). 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.
McpResourceTools.ParseFlags (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1259— McpResourceTools.ParseFlags has cognitive complexity 18 (threshold 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.
McpBrowseTools.SameData (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:1326— McpBrowseTools.SameData has cognitive complexity 18 (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.
McpEditorTools.BackupAllLevels (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:2013— McpEditorTools.BackupAllLevels has cognitive complexity 18 (threshold 15). 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.
McpImportTools.InspectPackage (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:863— McpImportTools.InspectPackage has cognitive complexity 18 (threshold 15). Of this number, 14 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.
McpImportTools.ImportPackage (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:934— McpImportTools.ImportPackage has cognitive complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 955, 973, 939, …). 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.
McpScriptTools.FrameFor (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:778— McpScriptTools.FrameFor has cognitive complexity 18 (threshold 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.
McpActivity.SaysNoChange (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpServer.cs:905— McpActivity.SaysNoChange has cognitive complexity 18 (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.
McpViewportTools.ResolveTarget (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:303— McpViewportTools.ResolveTarget has cognitive complexity 18 (threshold 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.
McpPlatformTools.Activity (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpPlatformTools.cs:54— McpPlatformTools.Activity has cognitive complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
McpCharacterTools.ReadNpcs (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:254— McpCharacterTools.ReadNpcs has cognitive complexity 18 (threshold 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.
McpCollision.ModelNames (cognitive 18) Source/OpenCAGE/Scripts/MCP/McpCollision.cs:148— McpCollision.ModelNames has cognitive complexity 18 (threshold 15). 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.
LiveLinkActivity.Index (cognitive 18) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkActivity.cs:321— LiveLinkActivity.Index has cognitive complexity 18 (threshold 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.
LevelViewerPanel.ApplyStateInfo (cognitive 17) Source/OpenCAGE/DockPanels/LevelViewerPanel.Toolbar.cs:445— LevelViewerPanel.ApplyStateInfo has cognitive complexity 17 (threshold 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.
EditAnimationMetadata.FillEntries (cognitive 17) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:334— EditAnimationMetadata.FillEntries has cognitive complexity 17 (threshold 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.
CompositeDisplay.LoadEntity (cognitive 17) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1930— CompositeDisplay.LoadEntity has cognitive complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: 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.
CompositeDisplay.CreateEntity (cognitive 17) Source/OpenCAGE/DockPanels/CompositeDisplay.cs:2958— CompositeDisplay.CreateEntity has cognitive complexity 17 (threshold 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.
CompositeBrowser.FillVisiblePreviews (cognitive 17) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:2642— CompositeBrowser.FillVisiblePreviews has cognitive complexity 17 (threshold 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.
Flowgraph.OnActivityTick (cognitive 17) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.LiveLink.cs:387— Flowgraph.OnActivityTick has cognitive complexity 17 (threshold 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.
LocalisationHandler.ParseStringsFromLines (cognitive 17) Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:161— LocalisationHandler.ParseStringsFromLines has cognitive complexity 17 (threshold 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.
LevelSoundImportDialog.Examine (cognitive 17) Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:581— LevelSoundImportDialog.Examine has cognitive complexity 17 (threshold 15). Of this number, 11 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.
LevelSoundBankDialog.LoadSounds (cognitive 17) Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:194— LevelSoundBankDialog.LoadSounds has cognitive 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 3 function literals inside it that branch (lines 197, 214, 237). 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.
ShowConnectedLinks.Populate (cognitive 17) Source/OpenCAGE/Popups/ShowConnectedLinks.cs:132— ShowConnectedLinks.Populate has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnimationTimeline.Describe (cognitive 17) Source/OpenCAGE/Popups/UserControls/AnimationTimeline.cs:267— AnimationTimeline.Describe has cognitive complexity 17 (threshold 15). 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.
AlienLevel.MergeFromDisk (cognitive 17) Source/OpenCAGE/Scripts/AlienLevel.cs:811— AlienLevel.MergeFromDisk has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OggWriter.WritePacket (cognitive 17) Source/OpenCAGE/Scripts/Audio/OggWriter.cs:28— OggWriter.WritePacket has cognitive complexity 17 (threshold 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.
AssetUsage.TextureUsers (cognitive 17) Source/OpenCAGE/Scripts/AssetUsage.cs:249— AssetUsage.TextureUsers has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecodedAudio.Mix (cognitive 17) Source/OpenCAGE/Scripts/Audio/WwiseAudioDecoder.cs:225— DecodedAudio.Mix has cognitive complexity 17 (threshold 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.
WwiseSoundLibrary.Collect (cognitive 17) Source/OpenCAGE/Scripts/Audio/WwiseSoundLibrary.cs:700— WwiseSoundLibrary.Collect has cognitive complexity 17 (threshold 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.
WwiseAdpcmWriter.Build (cognitive 17) Source/OpenCAGE/Scripts/Audio/WwiseAdpcmWriter.cs:32— WwiseAdpcmWriter.Build has cognitive complexity 17 (threshold 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.
WwiseBankBuilder.Write (cognitive 17) Source/OpenCAGE/Scripts/Audio/WwiseBankBuilder.cs:674— WwiseBankBuilder.Write has cognitive complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 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.
ModExportBuilder.FriendlyConfigName (cognitive 17) Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:559— ModExportBuilder.FriendlyConfigName has cognitive complexity 17 (threshold 15). 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.
AnimationStringsMerge.Merge (cognitive 17) REDACTED:333— AnimationStringsMerge.Merge has cognitive complexity 17 (threshold 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.
LoadedGameFiles.Stamps (cognitive 17) Source/OpenCAGE/Scripts/LoadedGameFiles.cs:291— LoadedGameFiles.Stamps has cognitive complexity 17 (threshold 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.
CompositePreviewImages.AddTransientPreviews (cognitive 17) Source/OpenCAGE/Scripts/CompositePreviewImages.cs:196— CompositePreviewImages.AddTransientPreviews has cognitive complexity 17 (threshold 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.
Document.BuildSkins (cognitive 17) Source/OpenCAGE/Scripts/ModelExport/FbxExporter.cs:526— Document.BuildSkins has cognitive complexity 17 (threshold 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.
ModelMetadata.FindSubmesh (cognitive 17) Source/OpenCAGE/Scripts/ModelIO.cs:118— ModelMetadata.FindSubmesh has cognitive complexity 17 (threshold 15). 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.
ModelCompositeBuilder.Problem (cognitive 17) Source/OpenCAGE/Scripts/ModelCompositeBuilder.cs:50— ModelCompositeBuilder.Problem has cognitive complexity 17 (threshold 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.
NodeUtils.GetDynamicPinParameters (cognitive 17) Source/OpenCAGE/Scripts/NodeUtils.cs:86— NodeUtils.GetDynamicPinParameters has cognitive complexity 17 (threshold 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.
ZoneColours.IndexTable (cognitive 17) Source/OpenCAGE/Scripts/ZoneColours.cs:275— ZoneColours.IndexTable has cognitive complexity 17 (threshold 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.
ShowCrossRefs.RemoveSelectedReferences (cognitive 17) Source/OpenCAGE/Popups/ShowCrossRefs.cs:484— ShowCrossRefs.RemoveSelectedReferences has cognitive complexity 17 (threshold 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.
ViewerEntitySync.DeleteReleasedAliases (cognitive 17) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntitySync.cs:251— ViewerEntitySync.DeleteReleasedAliases has cognitive complexity 17 (threshold 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.
ViewerResourceSync.FingerprintMaterials (cognitive 17) Source/OpenCAGE/Scripts/Unity Connection/ViewerResourceSync.cs:561— ViewerResourceSync.FingerprintMaterials has cognitive complexity 17 (threshold 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. This shape REPEATS in the file: one other method here (ViewerResourceSync.FingerprintShaders) 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.
ViewerResourceSync.FingerprintShaders (cognitive 17) Source/OpenCAGE/Scripts/Unity Connection/ViewerResourceSync.cs:598— ViewerResourceSync.FingerprintShaders has cognitive complexity 17 (threshold 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. This shape REPEATS in the file: one other method here (ViewerResourceSync.FingerprintMaterials) 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.
ViewerScriptResync.NoteInto (cognitive 17) Source/OpenCAGE/Scripts/Unity Connection/ViewerScriptResync.cs:148— ViewerScriptResync.NoteInto has cognitive complexity 17 (threshold 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.
ViewerEntityDuplicateSync.ApplyCore (cognitive 17) Source/OpenCAGE/Scripts/Unity Connection/ViewerEntityDuplicateSync.cs:43— ViewerEntityDuplicateSync.ApplyCore has cognitive complexity 17 (threshold 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.
McpAssets.FindMaterial (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2225— McpAssets.FindMaterial has cognitive complexity 17 (threshold 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.
McpAnimationAssetTools.EditAnimTreeLayout (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4239— McpAnimationAssetTools.EditAnimTreeLayout has cognitive complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4252, 4277). 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.
McpCageAnimationTools.CameraPathOf (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3533— McpCageAnimationTools.CameraPathOf has cognitive complexity 17 (threshold 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.
McpLevelTools.AwaitGameAnimation (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:1718— McpLevelTools.AwaitGameAnimation has cognitive complexity 17 (threshold 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.
McpPageTools.MergePage (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpPageTools.cs:466— McpPageTools.MergePage has cognitive complexity 17 (threshold 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.
McpResourceTools.ListCollisionProxies (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1472— McpResourceTools.ListCollisionProxies has cognitive complexity 17 (threshold 15). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 1474, 1496). 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.
McpValues.ReadEnum (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpScript.cs:1159— McpValues.ReadEnum has cognitive complexity 17 (threshold 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.
McpScriptEdit.PlacementCount (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:416— McpScriptEdit.PlacementCount has cognitive complexity 17 (threshold 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.
McpScriptEdit.AddVariable (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:558— McpScriptEdit.AddVariable has cognitive complexity 17 (threshold 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.
McpScriptTools.Place (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1065— McpScriptTools.Place has cognitive 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, 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.
McpScriptTools.Link (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1733— McpScriptTools.Link has cognitive complexity 17 (threshold 15). 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.
McpViewportTools.SnapToFloor (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2072— McpViewportTools.SnapToFloor has cognitive complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2131, 2077, 2114). 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.
McpCharacterTools.Floors (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs:789— McpCharacterTools.Floors has cognitive complexity 17 (threshold 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.
McpZoneTools.StateOf (cognitive 17) Source/OpenCAGE/Scripts/MCP/McpZoneTools.Model.cs:172— McpZoneTools.StateOf has cognitive complexity 17 (threshold 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.
LiveLinkDebugger.PickFromGame (cognitive 17) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:575— LiveLinkDebugger.PickFromGame has cognitive complexity 17 (threshold 15). 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.
BlendSetUserPicker.Build (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/BlendSetUserPicker.cs:70— BlendSetUserPicker.Build has cognitive complexity 16 (threshold 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.
EditAnimationMetadata.Same (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/EditAnimationMetadata.cs:871— EditAnimationMetadata.Same has cognitive complexity 16 (threshold 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.
ImportAnimation.Describe (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/ImportAnimation.cs:217— ImportAnimation.Describe has cognitive complexity 16 (threshold 15). 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.
AnimationPreview.BadFitWarning (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/AnimationPreview.cs:545— AnimationPreview.BadFitWarning has cognitive complexity 16 (threshold 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.
CompositeBrowser.CompositeBrowser_FormClosed (cognitive 16) Source/OpenCAGE/DockPanels/CompositeBrowser.cs:536— CompositeBrowser.CompositeBrowser_FormClosed has cognitive complexity 16 (threshold 15). 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.
EntityInspector.AddDefaults (cognitive 16) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:967— EntityInspector.AddDefaults has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
EntityInspector.SummariseMultiSelectionTypes (cognitive 16) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1054— EntityInspector.SummariseMultiSelectionTypes has cognitive complexity 16 (threshold 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.
Flowgraph.ConfigureBreakpointItems (cognitive 16) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Debugger.cs:251— Flowgraph.ConfigureBreakpointItems has cognitive 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.
GraphicsEditor.SyncPresets (cognitive 16) Source/OpenCAGE/Popups/Configuration Editors/GraphicsEditor.cs:379— GraphicsEditor.SyncPresets has cognitive complexity 16 (threshold 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.
LocalisationEditor.updateString_Click (cognitive 16) Source/OpenCAGE/Popups/Configuration Editors/LocalisationEditor.cs:266— LocalisationEditor.updateString_Click has cognitive complexity 16 (threshold 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.
LocalisationHandler.GetLocalisedString (cognitive 16) Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:70— LocalisationHandler.GetLocalisedString has cognitive complexity 16 (threshold 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.
LevelSoundOverrideEditor.Fill (cognitive 16) Source/OpenCAGE/Popups/LevelSoundOverrideEditor.cs:344— LevelSoundOverrideEditor.Fill has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LevelBackupManager.saveBackup_Click (cognitive 16) Source/OpenCAGE/Popups/LevelBackupManager.cs:200— LevelBackupManager.saveBackup_Click has cognitive complexity 16 (threshold 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.
CompositeArchive.WriteArchive (cognitive 16) Source/OpenCAGE/Scripts/CompositeArchive.cs:303— CompositeArchive.WriteArchive has cognitive complexity 16 (threshold 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.
PackageHandover.TrySend (cognitive 16) Source/OpenCAGE/Scripts/PackageHandover.cs:66— PackageHandover.TrySend has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TextureImportOptions.BuildPersistentSlider (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/TextureImportOptions.cs:163— TextureImportOptions.BuildPersistentSlider has cognitive 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, 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.
SelectShaderPermutation.Refill (cognitive 16) Source/OpenCAGE/Popups/Resource Editors/SelectShaderPermutation.cs:283— SelectShaderPermutation.Refill has cognitive complexity 16 (threshold 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.
CompositeEntityList.DoSearch (cognitive 16) Source/OpenCAGE/Popups/UserControls/CompositeEntityList.cs:1292— CompositeEntityList.DoSearch has cognitive complexity 16 (threshold 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.
LevelSoundOverride.Remove (cognitive 16) Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs:495— LevelSoundOverride.Remove has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WwiseSoundLibrary.Resolve (cognitive 16) Source/OpenCAGE/Scripts/Audio/WwiseSoundLibrary.cs:527— WwiseSoundLibrary.Resolve has cognitive complexity 16 (threshold 15). 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.
WwiseVorbisConverter.Parse (cognitive 16) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:89— WwiseVorbisConverter.Parse has cognitive complexity 16 (threshold 15). 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.
SoundPreviewPanel.Replace (cognitive 16) Source/OpenCAGE/UserControls/SoundPreviewPanel.cs:610— SoundPreviewPanel.Replace has cognitive complexity 16 (threshold 15). 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.
ThemeNative.SetControlTheme (cognitive 16) Source/OpenCAGE/Scripts/Theming/ThemeNative.cs:343— ThemeNative.SetControlTheme has cognitive complexity 16 (threshold 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.
BmlPatch.WithoutInherited (cognitive 16) REDACTED:182— BmlPatch.WithoutInherited has cognitive complexity 16 (threshold 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.
ModInstaller.LevelFiles (cognitive 16) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:376— ModInstaller.LevelFiles has cognitive complexity 16 (threshold 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.
ModInstaller.RestoreSnapshot (cognitive 16) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1271— ModInstaller.RestoreSnapshot has cognitive complexity 16 (threshold 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.
AnimationPakVersion.Union (cognitive 16) Source/OpenCAGE/Scripts/Modding/Merging/AnimationPakMerge.cs:77— AnimationPakVersion.Union has cognitive complexity 16 (threshold 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.
ModManagerForm.ShowDetailText (cognitive 16) Source/OpenCAGE/Popups/ModManagerForm.cs:621— ModManagerForm.ShowDetailText has cognitive complexity 16 (threshold 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.
ModManagerForm.ClashLines (cognitive 16) Source/OpenCAGE/Popups/ModManagerForm.cs:648— ModManagerForm.ClashLines has cognitive complexity 16 (threshold 15). Of this number, 14 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.
LayoutTrim.Restore (cognitive 16) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:191— LayoutTrim.Restore has cognitive 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowgraphLayoutManager.LoadCustomFlowgraphs (cognitive 16) Source/OpenCAGE/Scripts/FlowgraphLayoutManager.cs:860— FlowgraphLayoutManager.LoadCustomFlowgraphs has cognitive complexity 16 (threshold 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.
AnimationPakWrite.Unsaved (cognitive 16) Source/OpenCAGE/Scripts/AnimationPakWrite.cs:226— AnimationPakWrite.Unsaved has cognitive 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, 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.
CurveEditor.GetValueContentBounds (cognitive 16) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1615— CurveEditor.GetValueContentBounds has cognitive complexity 16 (threshold 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.
CAGEAnimationEditor.SetupAnimTimeline (cognitive 16) Source/OpenCAGE/Popups/Function Editors/CAGEAnimationEditor.cs:901— CAGEAnimationEditor.SetupAnimTimeline has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModelIO.ToSubmeshes (cognitive 16) Source/OpenCAGE/Scripts/ModelIO.cs:1452— ModelIO.ToSubmeshes has cognitive complexity 16 (threshold 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.
ListViewGroupNavigation.DisplayOrder (cognitive 16) Source/OpenCAGE/Scripts/ListViewGroupNavigation.cs:119— ListViewGroupNavigation.DisplayOrder has cognitive complexity 16 (threshold 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.
GlobalEntitySearchHelper.GetCompositesInScope (cognitive 16) Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:411— GlobalEntitySearchHelper.GetCompositesInScope has cognitive complexity 16 (threshold 15). 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.
ParameterGridPanel.TrackTransformRows (cognitive 16) Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:302— ParameterGridPanel.TrackTransformRows has cognitive complexity 16 (threshold 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.
GridTabNavigator.FindByPath (cognitive 16) Source/OpenCAGE/Scripts/ParameterGrid/GridTabNavigator.cs:226— GridTabNavigator.FindByPath has cognitive complexity 16 (threshold 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.
McpAssetTools.EditModelTool (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:603— McpAssetTools.EditModelTool has cognitive complexity 16 (threshold 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.
McpAnimationAssetTools.Outline (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:4702— McpAnimationAssetTools.Outline has cognitive complexity 16 (threshold 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.
McpGlobalAssetChecks.Distance (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5658— McpGlobalAssetChecks.Distance has cognitive complexity 16 (threshold 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.
McpEditingTools.ListDeadProxies (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:827— McpEditingTools.ListDeadProxies has cognitive complexity 16 (threshold 15). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 829). 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.
Step.Flag (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1847— Step.Flag has cognitive complexity 16 (threshold 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.
McpPlacements.OverridesIn (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:1955— McpPlacements.OverridesIn has cognitive complexity 16 (threshold 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.
McpBrowseTools.DescribeEntity (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:445— McpBrowseTools.DescribeEntity has cognitive complexity 16 (threshold 15). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 448, 474). 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.
McpValues.ToJson (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpScript.cs:899— McpValues.ToJson has cognitive complexity 16 (threshold 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.
McpScriptTools.FillSequence (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:1160— McpScriptTools.FillSequence has cognitive complexity 16 (threshold 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.
McpActivity.End (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpServer.cs:876— McpActivity.End has cognitive complexity 16 (threshold 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.
McpViewportTools.RunAction (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:1984— McpViewportTools.RunAction has cognitive complexity 16 (threshold 15). Of this number, 9 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.
LeafIndex.Near (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpZonePlanner.cs:82— LeafIndex.Near has cognitive complexity 16 (threshold 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.
McpSpatialTools.ReadFrame (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:217— McpSpatialTools.ReadFrame has cognitive complexity 16 (threshold 15). 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.
McpZoneTools.PinFeeds (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:380— McpZoneTools.PinFeeds has cognitive complexity 16 (threshold 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.
McpZoneTools.OtherZones (cognitive 16) Source/OpenCAGE/Scripts/MCP/McpZoneTools.cs:899— McpZoneTools.OtherZones has cognitive complexity 16 (threshold 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.
LiveLinkAnimationDrive.Describe (cognitive 16) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:466— LiveLinkAnimationDrive.Describe has cognitive complexity 16 (threshold 15). 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.
LiveLinkDebugger.ShowEntity (cognitive 16) Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkDebugger.cs:653— LiveLinkDebugger.ShowEntity has cognitive 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, 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.
Program.CopyProjectToBuild (cognitive 16) Source/Packager/Program.cs:52— Program.CopyProjectToBuild has cognitive complexity 16 (threshold 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.
D4 · Code Duplication· Near-duplicate member family (3 members, 10 shared lines) · ×1
Near-duplicate member family (3 members, 10 shared lines) Source/OpenCAGE/Scripts/MaterialApplier.cs:646— Source/OpenCAGE/Scripts/MaterialApplier.cs:646-741 | Source/OpenCAGE/Scripts/MaterialApplier.cs:808-855 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1372-1437 — These 3 members are variants of one another: a block of 10 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· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:18— Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:18-41 | Source/OpenCAGE/Scripts/Unity Connection/ViewerContextMenu.cs:53-76 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntityCreateSync.cs:17-42 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntityDuplicateSync.cs:18-41 | Source/OpenCAGE/Scripts/Unity Connection/ViewerParameterSync.cs:20-43 | Source/OpenCAGE/Scripts/Unity Connection/ViewerSelectionSync.cs:89-112 | Source/OpenCAGE/Scripts/Unity Connection/ViewerUndoSync.cs:12-35 | Source/OpenCAGE/Scripts/Unity Connection/ViewerViewportModeSync.cs:13-36 — These 8 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 8 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 8 times.
D4 · Code Duplication· Edited copy of a member (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:93— Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:93-172 | Source/OpenCAGE/Scripts/Audio/WwiseCodebooks.cs:249-315 — 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 (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:773— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:773-837 | Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:2046-2117 — These two members are one piece of code written twice and then edited apart: 65 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 (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) Source/OpenCAGE/Popups/ImportComposites.cs:238— Source/OpenCAGE/Popups/ImportComposites.cs:238-309 | Source/OpenCAGE/Popups/ImportCompositeArchive.cs:321-375 — These two members are one piece of code written twice and then edited apart: 55 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddStringEvent.cs:17— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddStringEvent.cs:17-57 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CAGEAnimation_AddKeyframeAtTime.cs:18-65 — These two members are one piece of code written twice and then edited apart: 41 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 (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:269— Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:269-318 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:378-412 — 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 copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:361— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:361-397 | Source/OpenCAGE/Scripts/ParameterGrid/ParameterGridPanel.cs:937-982 — 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 copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2173— Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2173-2226 | Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2229-2275 — These two members are one piece of code written twice and then edited apart: 47 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) Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:218— Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:218-255 | Source/OpenCAGE/Popups/Resource Editors/EditMaterial.cs:929-961 — 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 copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:241— Source/OpenCAGE/Popups/Resource Editors/EditCollisionProxy.cs:241-267 | Source/OpenCAGE/Popups/Resource Editors/EditPhysicsSystem.cs:321-347 — 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 (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) Source/OpenCAGE/Popups/Resource Editors/AnimationSkeletonPicker.cs:100— Source/OpenCAGE/Popups/Resource Editors/AnimationSkeletonPicker.cs:100-121 | Source/OpenCAGE/Popups/Resource Editors/SkeletonPicker.cs:34-54 — 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 (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:364— Source/OpenCAGE/Scripts/Audio/WwiseVorbisConverter.cs:364-407 | Source/OpenCAGE/Scripts/Audio/WwiseVorbisWriter.cs:445-478 — These two members are one piece of code written twice and then edited apart: 34 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, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:371— Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:371-394 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:397-429 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:432-458 | Source/OpenCAGE/Popups/Configuration Editors/ConfigEditorUtils.cs:496-519 — 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 copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) Source/OpenCAGE/Scripts/CompositePreviewManager.cs:381— Source/OpenCAGE/Scripts/CompositePreviewManager.cs:381-405 | Source/OpenCAGE/Scripts/CompositePreviewManager.cs:409-432 — 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· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1119— Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:1119-1131 | Source/OpenCAGE/Scripts/AnimationPakWrite.cs:362-374 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3313-3323 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3666-3678 — 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 (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) REDACTED:1143— REDACTED:1143-1150 | REDACTED:1389-1396 | REDACTED:1492-1499 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:79— Source/OpenCAGE/Popups/AddEntity_CompositeInstance.cs:79-93 | Source/OpenCAGE/Popups/AddEntity_Function.cs:50-64 | Source/OpenCAGE/Popups/Resource Editors/EditModel.cs:1042-1065 — 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, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) Source/OpenCAGE/Scripts/EditorUtils.cs:987— Source/OpenCAGE/Scripts/EditorUtils.cs:987-997 | Source/OpenCAGE/Scripts/MCP/McpRegion.cs:393-398 | Source/OpenCAGE/Scripts/MCP/McpSpatialTools.cs:307-312 | Source/OpenCAGE/Scripts/ZoneColours.cs:316-325 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 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, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1637— Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:1637-1646 | Source/OpenCAGE/Scripts/GlobalEntitySearchHelper.cs:400-409 | Source/OpenCAGE/Scripts/Unity Connection/ViewerSelectionSync.cs:292-301 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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 (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) REDACTED:221— REDACTED:221-224 | Source/OpenCAGE/Scripts/Modding/ModExportBuilder.cs:769-771 — 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.
Duplicated block (45–46 lines × 2) Source/OpenCAGE/Scripts/MaterialApplier.cs:695— Source/OpenCAGE/Scripts/MaterialApplier.cs:695-740 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1392-1436 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:695` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Source/OpenCAGE/Scripts/MaterialApplier.cs:695` calls `GetParameterType` and `Source/OpenCAGE/Scripts/MaterialApplier.cs:1392` 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 (34 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:138— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:138-171 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:756-789 — 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 (29 lines × 2) Source/OpenCAGE/Popups/ImportCompositeArchive.cs:341— Source/OpenCAGE/Popups/ImportCompositeArchive.cs:341-369 | Source/OpenCAGE/Popups/ImportComposites.cs:275-303 — 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 `Source/OpenCAGE/Popups/ImportCompositeArchive.cs:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) Source/OpenCAGE/Popups/Configuration Editors/DifficultyEditor.cs:30— Source/OpenCAGE/Popups/Configuration Editors/DifficultyEditor.cs:30-51 | Source/OpenCAGE/Popups/Configuration Editors/ViewconeEditor.cs:27-48 — 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 (21–23 lines × 2) Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:30— Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs:30-50 | Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs:28-50 — before extracting anything, compare `Source/OpenCAGE/Popups/Resource Editors/PhysicsBodyProperties.cs` and `Source/OpenCAGE/Popups/Resource Editors/PhysicsImportSettings.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:822— Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:822-840 | Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:856-874 — both copies are in the same file, so extract the 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 after the matched lines, `Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:842` calls `Stop` and `Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:875` 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 (18 lines × 2) Source/OpenCAGE/Scripts/Unity Connection/Send.cs:208— Source/OpenCAGE/Scripts/Unity Connection/Send.cs:208-225 | Source/OpenCAGE/Scripts/Unity Connection/Send.cs:1110-1127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Source/OpenCAGE/Scripts/Unity Connection/Send.cs:1127` calls `GetPacketFilters`, `GetScenePacketFilters` and `Source/OpenCAGE/Scripts/Unity Connection/Send.cs:225` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 8) Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:20— Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:20-34 | Source/OpenCAGE/Scripts/Unity Connection/ViewerContextMenu.cs:55-69 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntityCreateSync.cs:21-35 | Source/OpenCAGE/Scripts/Unity Connection/ViewerEntityDuplicateSync.cs:20-34 | Source/OpenCAGE/Scripts/Unity Connection/ViewerParameterSync.cs:22-36 | Source/OpenCAGE/Scripts/Unity Connection/ViewerSelectionSync.cs:91-105 | Source/OpenCAGE/Scripts/Unity Connection/ViewerUndoSync.cs:14-28 | Source/OpenCAGE/Scripts/Unity Connection/ViewerViewportModeSync.cs:15-29 — 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 8 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Source/OpenCAGE/Scripts/Unity Connection/ViewerClipboardSync.cs:20` 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–17 lines × 2) Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1191— Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1191-1207 | Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1228-1238 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/Modding/ModInstaller.cs:1191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174— Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174-2190 | Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2230-2245 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:2174` 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) REDACTED:301— REDACTED:301-315 | REDACTED:254-268 — 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.
Duplicated block (10–15 lines × 3) Source/OpenCAGE/Scripts/LocalDebug.cs:294— Source/OpenCAGE/Scripts/LocalDebug.cs:294-308 | Source/OpenCAGE/Scripts/LocalDebug.cs:376-385 | Source/OpenCAGE/Scripts/LocalDebug.cs:493-502 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–14 lines × 2) Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:259— Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.Arrange.cs:259-272 | Source/OpenCAGE/Popups/Anim Tree Editor/AnimTreeCanvas.cs:805-815 — 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 (10–14 lines × 2) Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1458— Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1458-1467 | Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1539-1552 — both copies are in the same file, so extract the 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 `Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:1458` 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 × 3) Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:126— Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:126-138 | Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:222-234 | Source/OpenCAGE/Popups/Resource Editors/EditMaterialMapping.cs:251-263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–13 lines × 2) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:391— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:391-403 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3173-3180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1903— Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1903-1915 | Source/OpenCAGE/Popups/Function Editors/CAGEAnimation/CurveEditor.xaml.cs:1934-1945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 2) Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:217— Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:217-226 | Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:246-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Source/OpenCAGE/Scripts/TriggerSequenceMembers.cs:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 3) Source/OpenCAGE/Scripts/MaterialApplier.cs:726— Source/OpenCAGE/Scripts/MaterialApplier.cs:726-736 | Source/OpenCAGE/Scripts/MaterialApplier.cs:846-855 | Source/OpenCAGE/Scripts/MaterialApplier.cs:1422-1432 — 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 `Source/OpenCAGE/Scripts/MaterialApplier.cs:726` 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 (8–11 lines × 2) Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:378— Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:378-388 | Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:3185-3192 — 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 (10–11 lines × 2) Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1422— Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1422-1432 | Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2195-2204 — 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 `Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs:1422` 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 (7–8 lines × 2) Source/OpenCAGE/Popups/Configuration Editors/GlobalConstantsEditor.cs:31— Source/OpenCAGE/Popups/Configuration Editors/GlobalConstantsEditor.cs:31-38 | Source/OpenCAGE/Popups/Configuration Editors/GlobalConstantsEditor.cs:109-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2184— Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:2184-2189 | Source/OpenCAGE/Scripts/ModelCompositeBuilder.cs:186-192 — 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 (4–5 lines × 3) Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1111— Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1111-1115 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1117-1121 | Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1128-1131 — 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 `Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:1111` 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. 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.
Outbound HTTP without resilience Source/OpenCAGE/Program.cs:556— `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
Third-party script without Subresource Integrity Source/WebAPI/index.html:148— `https://unpkg.com/react@17/umd/react.development.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 7 such include(s) across the repository's markup.
Sync-over-async (deadlock risk) through `Task.WaitAll` Source/OpenCAGE/Scripts/Modding/LevelMerge.cs:273— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×1
Length read from the parsed input is spent without ever being bounded Source/OpenCAGE/Scripts/Modding/ShaderDatabase.cs:291— `blobCount` is read from the stream being parsed at line 290 (`ReadInt32`), then used to size an array at line 291 — and nowhere in this method is `blobCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `blobCount` against the bytes actually remaining in the stream before spending it.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the method that made it · ×1
Disposable created and abandoned in the method that made it Source/OpenCAGE.MCP/Program.cs:116— `stdin` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 116). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var stdin = …;`), which releases it at the end of the scope on every path including a throw.
X28 · Index access outside its own emptiness guard· Index access outside its own emptiness guard · ×1
Index access outside its own emptiness guard Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs:2423— This access `latest[0]` has no test of the length of `latest` on its own path, while this method tests it for that position at line 2422 (`latest.Count != 0`): where that test fails, this read throws. Either the test is load-bearing and this read needs it too, or the length of `latest` is fixed here and the test is dead.
redundant comment Source/Downloader/Properties/AssemblyInfo.cs:5— "General Information about an assembly is controlled through the following set of attributes. Change these attribute values to modify the information associated …" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/Downloader/Properties/AssemblyInfo.cs:17— "Setting ComVisible to false makes the types in this assembly not visible to COM components. If you need to access a type in this assembly from COM, set the ComV …" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/Downloader/Properties/AssemblyInfo.cs:22— "The following GUID is for the ID of the typelib if this project is exposed to COM" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.PinValues.cs:209— "The pins a link comes in to on one entity, over every page" repeats the code it sits on: 4 of its 5 words (pins, link, entity, page) are already in `private HashSet<ShortGuid> LinkedInputPins(Entity entity)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/DockPanels/Composite Panels/Flowgraph.cs:1352— "add new node for the selected entity, if one's selected" repeats the code it sits on: 4 of its 5 words (add, node, selected, entity) are already in `private void addNodeForSelectedEntityToolStripMenuItem_Click(object sender, EventArgs e)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/DockPanels/CompositeBrowser.cs:1649— "File Browser Context Menu" repeats the code it sits on: 4 of its 4 words (file, browser, context, menu) are already in `private void FooListView_MouseDown(object sender, MouseEventArgs e)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/DockPanels/CompositeDisplay.cs:855— "Saves and compiles all Flowgraph layouts for this Composite" repeats the code it sits on: 5 of its 5 words (saves, compiles, flowgraph, layouts, composite) are already in `public void SaveAllFlowgraphs()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/DockPanels/CompositeDisplay.cs:1371— "Load a child composite within this composite" repeats the code it sits on: 3 of its 3 words (load, child, composite) are already in `public void LoadChild(Composite composite, Entity entity)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/AddEntity_Function.cs:98— "A composite can only have one EnvironmentModelReference" repeats the code it sits on: 4 of its 5 words (composite, environment, model, reference) are already in `if (function == FunctionType.EnvironmentModelReference && _composite.functions.FirstOrDefault(o => o.function == Functio …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:104— "Update a localised string" repeats the code it sits on: 3 of its 3 words (update, localised, string) are already in `public bool UpdateLocalisedString(LocalisedText Text)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:200— "Get all text IDs by language" repeats the code it sits on: 4 of its 4 words (get, text, ds, language) are already in `public List<LocalisedText> GetAllIDs(AYZ_Lang Language)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/ControlsWindow.cs:43— "Entity list controls" repeats the code it sits on: 3 of its 3 words (entity, list, controls) are already in `AddControl(EntityListControls, "Previous / Next Entity", "Up / Down (group headers skipped)");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/ControlsWindow.cs:53— "Model viewer controls" repeats the code it sits on: 3 of its 3 words (model, viewer, controls) are already in `AddControl(ModelViewerControls, "Zoom In/Out", "Scrollwheel Up/Down");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/ControlsWindow.cs:59— "Level viewer controls" repeats the code it sits on: 3 of its 3 words (level, viewer, controls) are already in `AddControl(LevelViewerControls, "Look", "Drag While Holding Right Mouse");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/LaunchGame.cs:75— "The scripting helpers are the runtime utils ASI" repeats the code it sits on: 4 of its 5 words (scripting, helpers, runtime, utils) are already in `internal static bool ScriptingHelpersAvailable()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/LaunchGame.cs:668— "Enable/disable the hot reload scripting helper" repeats the code it sits on: 5 of its 6 words (enable, hot, reload, scripting, helper) are already in `private void enableHotReload_CheckedChanged(object sender, EventArgs e)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/LaunchGame.cs:772— "The four features with a key (Hot Reload, Unlock Mouse, Possess Characters, the Debug Menu): their names, whether each is on, and their keys, as the settings sa …" repeats the code it sits on: 13 of its 16 words (features, key, hot, reload, unlock, mouse, possess, characters, debug, menu, names, keys, settings) are already in `private static (string Name, bool On, string Key)[] KeyedFeatures()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/LaunchGame.cs:972— "Render constant ambient" repeats the code it sits on: 3 of its 3 words (render, constant, ambient) are already in `private void renderConstantAmbient_CheckedChanged(object sender, EventArgs e)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/ModExporterForm.cs:119— "A row's size, or that the mod deletes the file" repeats the code it sits on: 4 of its 5 words (size, mod, deletes, file) are already in `private string Describe(string normalisedPath)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Popups/ShowInstanceInfo.cs:51— "Decompose the final matrix back to position and rotation" repeats the code it sits on: 5 of its 6 words (decompose, final, matrix, position, rotation) are already in `Matrix4x4.Decompose(globalMatrix, out Vector3 scale, out Quaternion finalRotation, out Vector3 finalPosition);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Properties/AssemblyInfo.cs:5— "General Information about an assembly is controlled through the following set of attributes. Change these attribute values to modify the information associated …" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Properties/AssemblyInfo.cs:17— "Setting ComVisible to false makes the types in this assembly not visible to COM components. If you need to access a type in this assembly from COM, set the ComV …" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Properties/AssemblyInfo.cs:27— "The following GUID is for the ID of the typelib if this project is exposed to COM" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Properties/AssemblyInfo.cs:30— "Version information for an assembly consists of the following four values: Major Version Minor Version Build Number Revision You can specify all the values or y …" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Source/OpenCAGE/Scripts/AlienLevel.cs:77— "Create a new backup" repeats the code it sits on: 3 of its 3 words (create, new, backup) are already in `public void CreateBackup(string name)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
+ 22 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×40
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:243— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 243 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1196— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1196 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1198— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1198 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1202— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1202 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1210— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1210 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1217— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1217 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1221— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1221 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1224— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1224 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1225— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1225 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1229— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1229 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1237— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1237 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1244— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1244 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1248— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1248 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1251— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1251 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1252— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1252 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1377— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1377 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1506— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1506 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1511— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1511 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1537— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1537 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1540— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1540 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1546— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1546 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1552— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1552 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1574— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1574 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1578— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1578 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel Source/OpenCAGE/Scripts/LocalDebug.cs:1588— `Source/OpenCAGE/Scripts/LocalDebug.cs` reports through `Console.Write…` at line 1588 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Duplicated predicate Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:5727— `!(entity is FunctionEntity function) || !function.function.IsFunctionType` appears character-identically in 3 files — Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs, Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs, Source/OpenCAGE/Scripts/MCP/McpScript.cs. 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 Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs:336— `!(o is VariableEntity) && (filter == null || McpScript.EntityName(commands, composite, o).IndexOf(filter, StringComparison.OrdinalIgnoreCase…` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs, Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs:439— `!call.Has("composite") || !call.Has("entity")` appears character-identically in 3 files — Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs, Source/OpenCAGE/Scripts/MCP/McpCharacterTools.cs, Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:720— `!call.Has("composite") || !call.Has("instance")` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpBrowseTools.cs, Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs:286— `!display.Populated || display.Composite != composite` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpScriptEdit.cs, Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs. 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 Source/OpenCAGE/DockPanels/CompositeBrowser.cs:2750— `!e.ExternalChange || e.ChangedKeys.Count == 0 || IsDisposed` appears character-identically in 4 files — Source/OpenCAGE/DockPanels/CompositeBrowser.cs, Source/OpenCAGE/DockPanels/EntitySearch.cs, Source/OpenCAGE/Popups/GlobalEntitySearcher.cs, Source/OpenCAGE/Popups/LaunchGame.cs. 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 Source/OpenCAGE/Scripts/ModelExport/FbxExporter.cs:498— `!material.GetMaterialTexture(type, 0, out TextureSlot slot) || string.IsNullOrEmpty(slot.FilePath)` appears character-identically in 2 files — Source/OpenCAGE/Scripts/ModelExport/FbxExporter.cs, Source/OpenCAGE/Scripts/ModelExport/GltfExporter.cs. 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 Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:48— `!string.IsNullOrEmpty(directory) && Directory.Exists(directory)` appears character-identically in 2 files — Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs, Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs:549— `!string.IsNullOrEmpty(text) && !Notes.Contains(text)` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs, Source/OpenCAGE/Scripts/MCP/McpTool.cs. 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 Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs:956— `(composite?.name ?? "").EndsWith("\\") || (composite?.name ?? "").EndsWith("/")` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpEditingTools.cs, Source/OpenCAGE/Scripts/MCP/McpScriptTools.cs. 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 Source/OpenCAGE/Scripts/CathodeLibExtensions.cs:657— `Char.IsNumber(str[i]) || (str[i] == '.' && allowDots) || (str[i] == '-')` appears character-identically in 2 files — Source/OpenCAGE/Scripts/CathodeLibExtensions.cs, Source/OpenCAGE/Scripts/EditorUtils.cs. 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 Source/OpenCAGE/DockPanels/CompositeDisplay.cs:254— `DockState == DockState.Hidden || DockState == DockState.Unknown` appears character-identically in 2 files — Source/OpenCAGE/DockPanels/CompositeBrowser.cs, Source/OpenCAGE/DockPanels/CompositeDisplay.cs. 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 Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs:453— `File.Exists(path) && !call.Bool("overwrite")` appears character-identically in 5 files — Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs, Source/OpenCAGE/Scripts/MCP/McpAssetTools.cs, Source/OpenCAGE/Scripts/MCP/McpImportTools.cs, Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs. 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 Source/OpenCAGE/DockPanels/CompositeDisplay.LiveLink.cs:53— `IsDisposed || Disposing || !IsHandleCreated` appears character-identically in 4 files — Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.LiveLink.cs, Source/OpenCAGE/DockPanels/CompositeDisplay.Debugger.cs, Source/OpenCAGE/DockPanels/CompositeDisplay.LiveLink.cs, Source/OpenCAGE/Popups/ProgressUI.cs. 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 Source/OpenCAGE/CommandsEditor.cs:505— `IsDisposed || Disposing || dockPanel == null || dockPanel.IsDisposed` appears character-identically in 2 files — Source/OpenCAGE/CommandsEditor.cs, Source/OpenCAGE/DockPanels/CompositeDisplay.cs. 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:74— `IsDisposed || Singleton.Editor?.DockPanel == null` appears character-identically in 2 files — Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs, Source/OpenCAGE/DockPanels/CompositeBrowser.cs. 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 Source/OpenCAGE/Popups/ImportCompositeArchive.cs:86— `IsPcStorefront(from) && IsPcStorefront(here)` appears character-identically in 2 files — Source/OpenCAGE/Popups/ImportCompositeArchive.cs, Source/OpenCAGE/Scripts/MCP/McpImportTools.cs. 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 Source/OpenCAGE/CommandsEditor.cs:3196— `LaunchGame.RuntimeUtilsSupports(Singleton.Platform) && SettingsManager.GetBool(Settings.RuntimeUtilsOpt)` appears character-identically in 2 files — Source/OpenCAGE/CommandsEditor.cs, Source/OpenCAGE/Scripts/RuntimeUtils Connection/Send.cs. 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 Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs:77— `Pane != null && DockState != DockState.Hidden && DockState != DockState.Float` appears character-identically in 3 files — Source/OpenCAGE/DockPanels/Composite Panels/EntityList.cs, Source/OpenCAGE/DockPanels/CompositeBrowser.cs, Source/OpenCAGE/DockPanels/EntitySearch.cs. 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 Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3466— `Send.Connected && ViewerResourceSync.ViewerReady && ViewerPopulateSync.ActivePopulateToken == 0` appears character-identically in 3 files — Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs, Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs, Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs:604— `SettingsManager.GetBool(Settings.DontWriteSaves) && !SettingsManager.GetBool(Settings.DebugMenu)` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpEditorTools.cs, Source/OpenCAGE/Scripts/MCP/McpLevelTools.cs. 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 Source/OpenCAGE/Scripts/Audio/SoundEventMetadata.cs:96— `Singleton.Editor == null || Singleton.Editor.CompositeBrowser == null` appears character-identically in 2 files — Source/OpenCAGE/Scripts/Audio/LevelSoundOverride.cs, Source/OpenCAGE/Scripts/Audio/SoundEventMetadata.cs. 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 Source/OpenCAGE/Scripts/MCP/McpImportTools.cs:991— `Singleton.Editor.CompositeDisplay?.Composite == null && shown != null` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpImportTools.cs, Source/OpenCAGE/Scripts/MCP/McpPortingTools.cs. 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 Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs:3482— `ViewerPopulateSync.PopulateEvents != populateEventsBefore || !Send.Connected` appears character-identically in 2 files — Source/OpenCAGE/Scripts/MCP/McpCageAnimationTools.cs, Source/OpenCAGE/Scripts/MCP/McpViewportTools.cs. 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 Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs:284— `Volatile.Read(ref _changes) == _pumpChanges || Interlocked.CompareExchange(ref _pumping, 1, 0) != 0` appears character-identically in 2 files — Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkAnimation.cs, Source/OpenCAGE/Scripts/RuntimeUtils Connection/LiveLinkTrace.cs. 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.
Silent fallback default in catch Source/OpenCAGE/DockPanels/LevelViewerPanel.cs:65— `IsRunning` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeEditor.cs:309— `HookGrid` swallows every exception and sets `_gridEditBox = null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/Anim Tree Editor/AnimationNodeProxy.cs:275— `Prototype` swallows every exception and sets `prototype = null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/Configuration Editors/LocalisationHandler.cs:63— `SamePath` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/LevelSoundImportDialog.cs:456— `SelectedOriginal` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/LevelSoundBankDialog.cs:395— `PackageHasBank` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/LaunchGame.cs:647— `RuntimeUtilsSwitch` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Popups/UserControls/CompositeTree.cs:253— `ComputeImplied` swallows every exception and sets `children = null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageFiles.cs:47— `IsPackage` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageFiles.cs:146— `WatchStash` swallows every exception and sets `_stashWatcher = null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageHandover.cs:97— `TrySend` swallows `UnauthorizedAccessException` into `return SendOutcome.NotAnswering;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageHandover.cs:143— `HasStash` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageHandover.cs:154— `ReadStashLines` swallows every exception into `return new List<string>();` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/PackageHandover.cs:171— `WithStashLock` swallows `AbandonedMutexException` and sets `held = true;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/AlienLevel.cs:475— `RevisionIsWhole` swallows `IOException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/AlienLevel.cs:568— `RestoreSome` swallows every exception and sets `LastRestoreFailure = RestoreFailure.Damaged;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/AlienLevel.cs:622— `RollBackRestore` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/Audio/SoundPreviewLibrary.cs:166— `PreferredLanguage` swallows every exception into `return "English(US)";` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/UiMovieOverrides.cs:258— `PutBackOldMenus` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/UiMovieOverrides.cs:284— `WithoutOldMenus` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/UiMovieOverrides.cs:304— `WithoutOwnedEntries` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/UiMovieOverrides.cs:339— `WithOwnedEntries` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/HiddenProcessLauncher.cs:87— `Start` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/NativeAssets.cs:72— `Beside` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch Source/OpenCAGE/Scripts/Textures/TextureConverter.cs:413— `DecodeAstc` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Commented-out code Source/OpenCAGE/CommandsEditor.cs:112— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/CommandsEditor.cs:115— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/CommandsEditor.cs:123— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/CommandsEditor.cs:124— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/CommandsEditor.cs:980— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/CommandsEditor.cs:981— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:675— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/DockPanels/Composite Panels/EntityInspector.cs:676— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/DockPanels/CompositeDisplay.cs:991— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Popups/Anim Tree Editor/AnimationSets.cs:40— 5 consecutive lines of code sit inside a `/* … */` block — a block of code switched off rather than removed, which rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Popups/SelectEnumString.cs:391— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Popups/UserControls/GUI_Resource_RenderableInstance.cs:57— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:55— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:56— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:133— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:134— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/ComboBoxExtensions.cs:135— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/EditorUtils.cs:87— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:479— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:480— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:483— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:484— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/LevelContent.cs:412— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/LevelContent.cs:414— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code Source/OpenCAGE/Scripts/LocalDebug.cs:219— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion Source/OpenCAGE/OpenCAGE.csproj:1— `OpenCAGE` overshoots its size bounds (197701 LoC, 705 public types across 25 namespaces). 2 of 4 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
Projects may be oversized for their cohesion Source/Downloader/Downloader.csproj:1— `Downloader` overshoots its size bounds (55 LoC, 705 public types across 25 namespaces). 2 of 4 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
No ADRs found Source/Downloader/Downloader.csproj:8— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Source/Downloader/Downloader.csproj` makes this repository a deployable product (line 8).
D21 · Naming Consistency· `uiPAK` spells `PAK` where 20 names in the project spell it `Pak` · ×1
`uiPAK` spells `PAK` where 20 names in the project spell it `Pak` Source/OpenCAGE/Popups/LaunchGame.cs:1018— 20 of 21 names in project OpenCAGE spell the token `Pak` (20 of 21; unit: names in project OpenCAGE containing `Pak`). Peers: CommandsEditor._editUiPak (Source/OpenCAGE/CommandsEditor.cs:4231); AnimTreeLayoutManager._loadedPak (Source/OpenCAGE/Scripts/AnimTreeLayoutManager.cs:26); OpenCAGE.AnimationPakWrite (Source/OpenCAGE/Scripts/AnimationPakWrite.cs:20); McpAnimationAssetTools._pendingPak (Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:738); McpAnimationAssetTools.WriteAnimationPak (Source/OpenCAGE/Scripts/MCP/McpAnimationAssetTools.cs:750). Rename to `uiPak`. [rule N6]
D21 · Naming Consistency· `ParseXML` spells `XML` where 12 names in the project spell it `Xml` · ×1
`ParseXML` spells `XML` where 12 names in the project spell it `Xml` Source/OpenCAGE/Scripts/EnumStringListViewItems.cs:514— 12 of 13 names in project OpenCAGE spell the token `Xml` (12 of 13; unit: names in project OpenCAGE containing `Xml`). Peers: LevelTextDBEditor.ReadXmlDbs (REDACTED:204); LevelTextDBEditor.ReadXmlDbs (REDACTED:207); LevelTextDBEditor.SaveXml (REDACTED:271); LevelTextDBEditor.SetXmlDbs (REDACTED:300); LevelTextDBEditor.AddXmlDbs (REDACTED:421). Rename to `ParseXml`. [rule N6]
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation Source/OpenCAGE/packages.config:3— `Source/OpenCAGE/packages.config` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 0/27 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Silent fallback default on parse failure Source/OpenCAGE/Popups/AddEntity_Function.cs:147— `functionTypeList_SelectedIndexChanged` falls back to `functionTypeList1.SelectedItem.Text` when `Enum.TryParse(functionTypeList1.SelectedItem.Text, out FunctionType type)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
doc comments repeat the names Source/OpenCAGE/Scripts/Theming/ThemeColours.cs:74— 0 of 71 documented parameters and 1 of 3796 summaries in `OpenCAGE` only repeat the member or parameter name (e.g. "Links." for `Link`). Delete the restating tags, or add what the name does not say.
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.
nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 3 file(s) — `Source/OpenCAGE/Scripts/MCP/McpResourceTools.cs`, `Source/OpenCAGE/Scripts/MCP/McpTool.cs`, `Source/OpenCAGE/Scripts/ModelIO.cs` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e661-ccfa-7241-bb23-28be1e979c11 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 362 · Warnings: 2375 · Recommendations: 213 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 22:02 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.