Public report of GlowPuff/ImperialCommander2, published 17 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, 17 November 2026, 09:46 UTC · Survey ID cd_b2a8078fe6b54bbbbd1b4141fafd8259
GlowPuff/ImperialCommander2
Measured 17 November 2026, 09:44 UTC, at code version a7bb921
First survey, so nothing to compare with yet
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 medium codebase: 30,050 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.5 person-years · Weakest lens: Production Readiness, 23.6
Findings by how serious they are
15 critical297 serious93 minor
10 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
17 November 2026, 09:44 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 ▸
42of 42 dimensions measured by tools.
387of 405 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
42dimensions across 5 lenses, read from 30,050 lines of product code in 2 projects.
GlowPuff/ImperialCommander2 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 36.0 out of 100 and is rated Weak, and 14 of its 15 critical findings are security problems.
Production Readiness, at 23.6, is the weakest lens and counts most in the score. The best first step is adding an automated build and test pipeline, worth about 8.0 points. Recording design decisions comes next, worth about 4.0 points. Raising Production Readiness to 70 would lift the score to about 47.1.
Thirteen passwords or keys are open to anyone who can read the repository. One known security hole in a package the code depends on can be used by attackers, and the project has no automated tests, so a change can break it without warning. Replacing each exposed password or key, updating the vulnerable packages and adding automated tests would close these risks.
The product code is 30,050 lines, about €68,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 23.6 to 70, the lowest score rated Strong, the score would rise from 36.0 to about 47.1.
Code composition: what the lines of code are
Business logic 51%Supporting code 49%
Rebuild cost: about €68,000 · Estimate
Cost to rebuild
€22,000 to €110,000, for 365 to 1,191 hours of work, about 0.5 person-years for one engineer
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 36. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 30,050 lines of product code, of which 28% is declarations and boilerplate, 21% straight logic and 51% logic with branches
Comment lines
The estimate prices 26,096 lines. Comment lines count towards the size of 30,050 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
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 8.0 points · Medium effort · CI/CD gates
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with ProjectVersion.txt.
Raises the score by about 4.0 points · Low effort · ADR Quality
3
Resolve the 1 No automated tests finding(s) in Code Coverage.
Raises the score by about 13.5 points · High effort · Code Coverage
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 €68,000 to build again, about 0.5 person-years of work. Its weakest lens is Production Readiness, at 23.6 (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
Add a CI workflow that builds and runs the test suite on every push/PR. Of all the actions in this report, it raises the score most for the work it takes: about 8.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 8,811 lines over the last 90 days, which is about 35,734 lines a year. At that pace, the extra work comes to an estimated 3.3 to 19.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
At a glance — Code Health · 38.8 · Weak · gated by X1, X5 ·
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
A07:2025 — Authentication Failures
14
High / Critical
A05:2025 — Injection
2
Medium
A03:2025 — Software Supply Chain Failures
1
High / Critical
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; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with ProjectVersion.txt.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a CI workflow that builds and runs the test suite on every push/PR.
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.
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Bring the 26 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with SagaAddHeroPanel.ShowContent (cyclomatic 58), MapEntityManager.Update (cyclomatic 39), FileManager.LoadCampaignPackage (cyclomatic 36).
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 — 15
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 — 297
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 — 93
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 10
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 42 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 — 42 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, 387 of 405 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.
D14 License Compliance — 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. Not scored — this repository declares its packages to Unity's package manager (UPM), in Packages/manifest.json and packages-lock.json, not to NuGet, so the .NET licence collector this dimension reads had no manifest to resolve. UPM package licences are not graded because the Unity package registry (packages.unity.com) publishes no licence field for the releases it serves and a packages-lock.json records none either — there is no licence metadata in this ecosystem to read, and packages resolved from a git URL have no registry behind them at all. A limit of what UPM publishes, NOT a finding that this repository's licences are compliant: this dimension asserts nothing about this repository's licensing in either direction.
D22 Internal API Consistency — 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. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API.
D28 Secrets (history) — 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. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `ImperialCommander2/Assets/Resources/Languages/Fr/help.json`, `ImperialCommander2/Assets/Resources/Languages/Hu/help.json`, `ImperialCommander2/Assets/Resources/Languages/It/help.json`, `ImperialCommander2/Assets/Resources/Languages/No/help.json`, `ImperialCommander2/Assets/Resources/Languages/Pl/help.json` and 8 more did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
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: a native UI project (ImperialCommander2/Assets/Plugins/Android/AndroidManifest.xml). 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. 666 further occurrence(s) are not listed individually; the score already reflects all 706.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
P8 Schema migrations — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
X4 Structured logging — 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. 15 further occurrence(s) are not listed individually; the score already reflects all 55.
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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
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.
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.
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.
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.
26 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SagaAddHeroPanel.ShowContent at 58. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being EventActionConverter.ReadJson at 34 — they are counted neither in the figure above nor in this dimension's score. 2 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: ImperialCommander2/Assets/Scripts/Saga/Converters/EventActionConverter.cs (EventActionConverter.ReadJson at 34), ImperialCommander2/Assets/Scripts/Common/InputManager.cs (InputManager.GetFocusedInput 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.
+ 21 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 26 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with SagaAddHeroPanel.ShowContent (cyclomatic 58), MapEntityManager.Update (cyclomatic 39), FileManager.LoadCampaignPackage (cyclomatic 36). — 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 26 together lifts Cyclomatic Complexity from 6.6 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
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.
+ 49 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cognitive Complexity — start with SagaAddHeroPanel.ShowContent (cognitive 126), TranslationController.InjectTranslationIntoMission (cognitive 85), FileManager.LoadCampaignPackage (cognitive 71). — 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 3 together lifts Cognitive Complexity from 4.4 to about 5.6/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 Classes8.6 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 5 TooManyMethods finding(s) in God Classes — start with MissionEventHandler.cs, SagaController.cs, TitleController.cs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 4 FileTooLong finding(s) in God Classes — start with DataStore.cs, SagaController.cs, SagaSetup.cs. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 MethodTooLong finding(s) in God Classes — start with TranslationController.cs, SagaAddHeroPanel.cs, EventActionConverter.cs. — One of this dimension's main actionable groups (3 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.
89 duplicated block group(s) detected. 11.4 % of the production lines (3,413 of 30,050) are in a reported copy. A further 56 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
Edited copy of a member (6 corresponding lines) · ×6ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:32
+ 67 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with SettingsPanel.cs (2), DGPrefab.cs (2), EnemyActivationPopup.cs. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 10 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with SettingsPanel.cs (2), SagaSetup.cs (2), ContinueCampaignPanel.cs. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 7 Edited copy of a member (12 corresponding lines) finding(s) in Code Duplication — start with CardViewPopup.cs, FileManager.cs, SettingsPanel.cs. — One of this dimension's main actionable groups (7 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.
2 production modules (Unity), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations, and main-sequence distance (abstractness) is not computed for these modules yet.
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 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with SessionData.cs, MapEntityManager.cs, DeploymentCard.cs. — One of this dimension's main actionable groups (3 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 dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
9 outdated, 0 deprecated direct UPM dependency(ies) of 12 graded, 0 pinning defect(s), across 1 UPM manifest(s) and 1 committed packages-lock.json. Currency is graded on the version each project RESOLVED in its lockfile, not the minimum its manifest declares, and against the newest release that project's own Unity editor can take — a later release requiring a newer editor is not counted as an upgrade this repository is behind on, because installing it is not something the owner can do without changing editor. Whether any of these packages is UNMAINTAINED is not graded: the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either — that is a source question, not a registry one. Known CVEs in this dependency graph are D30's question.
Outdated: com.unity.addressables · ×9
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 2 Hotspot finding(s) in Churn × Complexity Hotspots — start with SettingsPanel.cs, SagaSetup.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.
Do you agree with this assessment?
D16 · Bus Factor9.3 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
6 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is ImperialCommander2/Assets/Scripts/Screens/SagaController.cs. Counted over 86 of the 219 production source files in this repository: 129 are under the ~2,400-byte size floor this dimension measures over, and the remaining 4 have no attributable history left to measure.
Off-boarding risk: anonymized user #1
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.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 foundImperialCommander2/ProjectSettings/ProjectVersion.txt:1
What to do
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with ProjectVersion.txt. — 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 any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
13 finding(s): 0 critical, 13 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 13 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (13 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
2 finding(s): 0 critical, 0 high, 2 medium, 0 low. semgrep hit a parse error in 6 file(s) — `ImperialCommander2/Assets/Resources/Languages/Nl/Missions/Other/OTHER14_NL.json`, `ImperialCommander2/Assets/Resources/Languages/Nl/Missions/Other/OTHER15_NL.json`, `ImperialCommander2/Assets/Resources/Languages/Nl/Missions/Other/OTHER16_NL.json`, `ImperialCommander2/Assets/Resources/Languages/Nl/Missions/Other/OTHER17_NL.json`, `ImperialCommander2/Assets/Resources/Languages/Nl/Missions/Other/OTHER18_NL.json`, … (+1 more) — so no absence of findings in them is evidence of anything, and nothing in them was analysed. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
What to do
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.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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 90 of the 219 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 1 Change coupling finding(s) in Change Coupling — start with SagaController.cs. — One of this dimension's main actionable groups (1 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.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
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.
`SagaSession` is not registered, but `DataStore` creates it and keeps it in the static `sagaSessionData`, 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 (campaignGUID; e.g. `campaignGUID` at line 135). — ImperialCommander2/Assets/Scripts/GameCore/SagaSession.cs:7
`DeploymentCard` is not registered, but `SagaController` creates it and keeps it in the static `DataStore.deployedHeroes`, 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 (woundTrackerValue, trackerNumbers; e.g. `woundTrackerValue` at line 173). — ImperialCommander2/Assets/Scripts/Models/DeploymentCard.cs:7
`SagaGameVars` is not registered, but the singleton `SagaSession` creates it and keeps it in `gameVars`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (dgOverridesAll, dgOverrides, countdownTimers; e.g. `dgOverridesAll` at line 100). — ImperialCommander2/Assets/Scripts/GameCore/SagaGameVars.cs:9
`DeploymentGroupOverride` is not registered, but the singleton `SagaGameVars` creates it and keeps it in `dgOverridesAll`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (threatCost, modification, canReinforce, canRedeploy, canBeDefeated, useResetOnRedeployment; e.g. `threatCost` at line 79). — ImperialCommander2/Assets/Scripts/Saga/MissionModels/DeploymentGroupOverride.cs:7
`InputManager` 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 (Instance; e.g. `Instance` at line 57). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/Common/InputManager.cs:7
`DataStore` 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 (gameType, missionCards, deploymentHand, manualDeploymentList, deployedHeroes, deployedEnemies; e.g. `gameType` at line 107). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:9
`DOTweenModuleUtils` 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 (_initialized; e.g. `_initialized` at line 42). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:26
`FileManager` 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 (campaignPath, classicSessionPath, sagaSessionPath, campaignSessionPath, classicDefaultsPath, baseDocumentFolder; e.g. `campaignPath` at line 28). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:11
`RunningCampaign` 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 (sagaCampaignGUID, expansionCode, campaignStructure, sagaCampaign; e.g. `sagaCampaignGUID` at line 14). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/GameCore/RunningCampaign.cs:5
`TranslationController` 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 (_instance; e.g. `_instance` at line 16). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:7
`SagaCampaign` 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 (campaignDataItems, campaignDataSkills, campaignDataRewards, campaignDataStructures; e.g. `campaignDataItems` at line 108). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:13
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.
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 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 · 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.
Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored. (×5) — ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs:4, ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:90, ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:101, …
1 guard above `return 0;` also returns `0`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/ModifyCustomPropsPopup.cs:82
A `#pragma warning disable` with no error codes silences every warning for the rest of the file — hidden debt. Suppress specific codes with a justification instead. — ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:55
A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×33) — ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:35, ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:64, ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:65, …
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.
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.
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 `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — 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.
`REDACTED` 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`. — REDACTED:3
What to do
Run what this repository's stack ships: `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — 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.
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.
Do you agree with this assessment?
X1 · Async correctness3.5 / 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. — ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ImportCampaignPanel.cs:41
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.
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.
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.
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/1 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. — ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ImportCampaignPanel.cs:41
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
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?
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.
`throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack. (×12) — ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:278, ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:293, ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:308, …
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. — ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:379
`cards` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref. — ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:434
`catch (Exception)` 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) — ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:51, ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:80
What to do
Rethrow loses stack trace (`throw ex;`)
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.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it. (×40) — ImperialCommander2/Assets/Scripts/Common/Extensions.cs:27, ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:237, ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:277, …
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This method contradicts itself about `tmme`: line 105 assigns it with `as TranslatedModifyMapEntity`, which hands back null rather than throwing when the value is not a `TranslatedModifyMapEntity`, but line 107 then dereferences it directly as `tmme.translatedEntityProperties` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `tmme` once before the first use and handle the null case, or cast with `(TranslatedModifyMapEntity)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:107
This method contradicts itself about `translatedEnemyDeployment`: line 129 assigns it with `as TranslatedEnemyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedEnemyDeployment`, but line 131 then dereferences it directly as `translatedEnemyDeployment.enemyName` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedEnemyDeployment` once before the first use and handle the null case, or cast with `(TranslatedEnemyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:131
This method contradicts itself about `translatedInputPrompt`: line 139 assigns it with `as TranslatedInputPrompt`, which hands back null rather than throwing when the value is not a `TranslatedInputPrompt`, but line 141 then dereferences it directly as `translatedInputPrompt.mainText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedInputPrompt` once before the first use and handle the null case, or cast with `(TranslatedInputPrompt)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:141
This method contradicts itself about `ttb`: line 155 assigns it with `as TranslatedTextBox`, which hands back null rather than throwing when the value is not a `TranslatedTextBox`, but line 157 then dereferences it directly as `ttb.tbText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `ttb` once before the first use and handle the null case, or cast with `(TranslatedTextBox)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:157
This method contradicts itself about `translatedChangeMissionInfo`: line 162 assigns it with `as TranslatedChangeMissionInfo`, which hands back null rather than throwing when the value is not a `TranslatedChangeMissionInfo`, but line 164 then dereferences it directly as `translatedChangeMissionInfo.theText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeMissionInfo` once before the first use and handle the null case, or cast with `(TranslatedChangeMissionInfo)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:164
This method contradicts itself about `translatedChangeObjective`: line 169 assigns it with `as TranslatedChangeObjective`, which hands back null rather than throwing when the value is not a `TranslatedChangeObjective`, but line 171 then dereferences it directly as `translatedChangeObjective.shortText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeObjective` once before the first use and handle the null case, or cast with `(TranslatedChangeObjective)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:171
This method contradicts itself about `translatedQuestionPrompt`: line 177 assigns it with `as TranslatedQuestionPrompt`, which hands back null rather than throwing when the value is not a `TranslatedQuestionPrompt`, but line 179 then dereferences it directly as `translatedQuestionPrompt.mainText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedQuestionPrompt` once before the first use and handle the null case, or cast with `(TranslatedQuestionPrompt)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:179
This method contradicts itself about `translatedAllyDeployment`: line 192 assigns it with `as TranslatedAllyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedAllyDeployment`, but line 194 then dereferences it directly as `translatedAllyDeployment.customName` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedAllyDeployment` once before the first use and handle the null case, or cast with `(TranslatedAllyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:194
This method contradicts itself about `translatedChangeGroupInstructions`: line 199 assigns it with `as TranslatedChangeGroupInstructions`, which hands back null rather than throwing when the value is not a `TranslatedChangeGroupInstructions`, but line 201 then dereferences it directly as `translatedChangeGroupInstructions.newInstructions` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeGroupInstructions` once before the first use and handle the null case, or cast with `(TranslatedChangeGroupInstructions)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:201
This method contradicts itself about `translatedChangeRepositionInstructions`: line 206 assigns it with `as TranslatedChangeRepositionInstructions`, which hands back null rather than throwing when the value is not a `TranslatedChangeRepositionInstructions`, but line 208 then dereferences it directly as `translatedChangeRepositionInstructions.repositionText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeRepositionInstructions` once before the first use and handle the null case, or cast with `(TranslatedChangeRepositionInstructions)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:208
This method contradicts itself about `translatedCustomEnemyDeployment`: line 213 assigns it with `as TranslatedCustomEnemyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedCustomEnemyDeployment`, but line 215 then dereferences it directly as `translatedCustomEnemyDeployment.repositionInstructions` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedCustomEnemyDeployment` once before the first use and handle the null case, or cast with `(TranslatedCustomEnemyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:215
This method contradicts itself about `translatedChangeTarget`: line 226 assigns it with `as TranslatedChangeTarget`, which hands back null rather than throwing when the value is not a `TranslatedChangeTarget`, but line 228 then dereferences it directly as `translatedChangeTarget.otherTarget` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeTarget` once before the first use and handle the null case, or cast with `(TranslatedChangeTarget)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:228
This method contradicts itself about `dp`: line 480 assigns it with `as DeploymentPoint`, which hands back null rather than throwing when the value is not a `DeploymentPoint`, but line 481 then dereferences it directly as `dp.deploymentPointProps` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `dp` once before the first use and handle the null case, or cast with `(DeploymentPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side. — ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:481
This method contradicts itself about `card`: line 555 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 584 then dereferences `card` as `card.id` AFTER the block has closed, where the guard no longer applies. A null `card` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `card` truly cannot be null by then, the guard above is misleading and should go. — ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:584
0/226 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
What to do
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Where a method null-tests a symbol and then uses it after the guarded block closes, move the trailing work inside the block — the guard skips its body on null, it does not stop the method.
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
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 — 2 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 — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 68 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — no DI registrations detected
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
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.
D14 License Compliance — UPM package licences not graded — the Unity registry publishes no licence metadata
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — N/A — no production declarations to compare.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — Production source is present (.cs) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No hand-written C#, Visual Basic, TypeScript or JavaScript source; comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
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
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
M4 Documentation accuracy — Not applicable: the 1 current-state document(s) make no claim of a kind M4 checks.
P12 CI test-gate honesty — no CI workflow found
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X10 Duplicated predicate — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X28 Index access outside its own emptiness guard — 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
X6 Hand-rolled structured-format parsing — 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.
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.
Serious — 297 finding(s)
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×13
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:107— This method contradicts itself about `tmme`: line 105 assigns it with `as TranslatedModifyMapEntity`, which hands back null rather than throwing when the value is not a `TranslatedModifyMapEntity`, but line 107 then dereferences it directly as `tmme.translatedEntityProperties` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `tmme` once before the first use and handle the null case, or cast with `(TranslatedModifyMapEntity)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:131— This method contradicts itself about `translatedEnemyDeployment`: line 129 assigns it with `as TranslatedEnemyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedEnemyDeployment`, but line 131 then dereferences it directly as `translatedEnemyDeployment.enemyName` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedEnemyDeployment` once before the first use and handle the null case, or cast with `(TranslatedEnemyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:141— This method contradicts itself about `translatedInputPrompt`: line 139 assigns it with `as TranslatedInputPrompt`, which hands back null rather than throwing when the value is not a `TranslatedInputPrompt`, but line 141 then dereferences it directly as `translatedInputPrompt.mainText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedInputPrompt` once before the first use and handle the null case, or cast with `(TranslatedInputPrompt)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:157— This method contradicts itself about `ttb`: line 155 assigns it with `as TranslatedTextBox`, which hands back null rather than throwing when the value is not a `TranslatedTextBox`, but line 157 then dereferences it directly as `ttb.tbText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `ttb` once before the first use and handle the null case, or cast with `(TranslatedTextBox)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:164— This method contradicts itself about `translatedChangeMissionInfo`: line 162 assigns it with `as TranslatedChangeMissionInfo`, which hands back null rather than throwing when the value is not a `TranslatedChangeMissionInfo`, but line 164 then dereferences it directly as `translatedChangeMissionInfo.theText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeMissionInfo` once before the first use and handle the null case, or cast with `(TranslatedChangeMissionInfo)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:171— This method contradicts itself about `translatedChangeObjective`: line 169 assigns it with `as TranslatedChangeObjective`, which hands back null rather than throwing when the value is not a `TranslatedChangeObjective`, but line 171 then dereferences it directly as `translatedChangeObjective.shortText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeObjective` once before the first use and handle the null case, or cast with `(TranslatedChangeObjective)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:179— This method contradicts itself about `translatedQuestionPrompt`: line 177 assigns it with `as TranslatedQuestionPrompt`, which hands back null rather than throwing when the value is not a `TranslatedQuestionPrompt`, but line 179 then dereferences it directly as `translatedQuestionPrompt.mainText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedQuestionPrompt` once before the first use and handle the null case, or cast with `(TranslatedQuestionPrompt)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:194— This method contradicts itself about `translatedAllyDeployment`: line 192 assigns it with `as TranslatedAllyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedAllyDeployment`, but line 194 then dereferences it directly as `translatedAllyDeployment.customName` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedAllyDeployment` once before the first use and handle the null case, or cast with `(TranslatedAllyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:201— This method contradicts itself about `translatedChangeGroupInstructions`: line 199 assigns it with `as TranslatedChangeGroupInstructions`, which hands back null rather than throwing when the value is not a `TranslatedChangeGroupInstructions`, but line 201 then dereferences it directly as `translatedChangeGroupInstructions.newInstructions` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeGroupInstructions` once before the first use and handle the null case, or cast with `(TranslatedChangeGroupInstructions)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:208— This method contradicts itself about `translatedChangeRepositionInstructions`: line 206 assigns it with `as TranslatedChangeRepositionInstructions`, which hands back null rather than throwing when the value is not a `TranslatedChangeRepositionInstructions`, but line 208 then dereferences it directly as `translatedChangeRepositionInstructions.repositionText` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeRepositionInstructions` once before the first use and handle the null case, or cast with `(TranslatedChangeRepositionInstructions)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:215— This method contradicts itself about `translatedCustomEnemyDeployment`: line 213 assigns it with `as TranslatedCustomEnemyDeployment`, which hands back null rather than throwing when the value is not a `TranslatedCustomEnemyDeployment`, but line 215 then dereferences it directly as `translatedCustomEnemyDeployment.repositionInstructions` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedCustomEnemyDeployment` once before the first use and handle the null case, or cast with `(TranslatedCustomEnemyDeployment)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:228— This method contradicts itself about `translatedChangeTarget`: line 226 assigns it with `as TranslatedChangeTarget`, which hands back null rather than throwing when the value is not a `TranslatedChangeTarget`, but line 228 then dereferences it directly as `translatedChangeTarget.otherTarget` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `translatedChangeTarget` once before the first use and handle the null case, or cast with `(TranslatedChangeTarget)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:481— This method contradicts itself about `dp`: line 480 assigns it with `as DeploymentPoint`, which hands back null rather than throwing when the value is not a `DeploymentPoint`, but line 481 then dereferences it directly as `dp.deploymentPointProps` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `dp` once before the first use and handle the null case, or cast with `(DeploymentPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:278— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:293— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:308— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:323— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:388— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:417— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:461— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:526— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:546— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:804— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:239— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPickerFolder.cs:68— `throw e;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Duplicated block (5 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:562— ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:562-566 | ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:576-580 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:744— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:744-748 | ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:761-765 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:62— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:62-66 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:123-127 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:62` 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:60— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:60-64 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionCardZoom.cs:21-25 — 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) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:664— ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:664-668 | ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:678-682 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:664` 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) ImperialCommander2/Assets/Scripts/MainGame/Dice.cs:81— ImperialCommander2/Assets/Scripts/MainGame/Dice.cs:81-86 | ImperialCommander2/Assets/Scripts/MainGame/Dice.cs:94-98 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:33— ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:33-37 | ImperialCommander2/Assets/Scripts/MainGame/MissionTextBox.cs:42-46 — 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 `ImperialCommander2/Assets/Scripts/MainGame/MissionTextBox.cs:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:171— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:171-175 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:192-196 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:233— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:233-237 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:297-301 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:168— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:168-172 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:218-222 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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. 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) ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:53— ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:53-57 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:70-74 — 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 `ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:53` 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) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:93— ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:93-101 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ImportCampaignPanel.cs:105-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:93` 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 (9 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:176— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:176-184 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:226-234 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 (9 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:295— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:295-303 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:189-197 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:291— ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:291-299 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:346-354 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:291` 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 (9 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:550— ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:550-558 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:617-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:591— ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:591-599 | ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:603-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:273— ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:273-281 | ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:356-364 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:273` 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 (9 lines × 2) ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:264— ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:264-272 | ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:287-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673-681 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:474-482 — 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:471— ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:471-480 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:504-512 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:471` 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.
AX2 · Stateful singletons· Process-global static state · ×7
Process-global static state: InputManager ImperialCommander2/Assets/Scripts/Common/InputManager.cs:7— `InputManager` 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 (Instance; e.g. `Instance` at line 57). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: DataStore ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:9— `DataStore` 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 (gameType, missionCards, deploymentHand, manualDeploymentList, deployedHeroes, deployedEnemies; e.g. `gameType` at line 107). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: DOTweenModuleUtils ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:26— `DOTweenModuleUtils` 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 (_initialized; e.g. `_initialized` at line 42). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: FileManager ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:11— `FileManager` 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 (campaignPath, classicSessionPath, sagaSessionPath, campaignSessionPath, classicDefaultsPath, baseDocumentFolder; e.g. `campaignPath` at line 28). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: RunningCampaign ImperialCommander2/Assets/Scripts/GameCore/RunningCampaign.cs:5— `RunningCampaign` 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 (sagaCampaignGUID, expansionCode, campaignStructure, sagaCampaign; e.g. `sagaCampaignGUID` at line 14). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: TranslationController ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:7— `TranslationController` 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 (_instance; e.g. `_instance` at line 16). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: SagaCampaign ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:13— `SagaCampaign` 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 (campaignDataItems, campaignDataSkills, campaignDataRewards, campaignDataStructures; e.g. `campaignDataItems` at line 108). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×7
Edited copy of a member (12 corresponding lines) ImperialCommander2/Assets/Scripts/MainGame/CardViewPopup.cs:21— ImperialCommander2/Assets/Scripts/MainGame/CardViewPopup.cs:21-36 | ImperialCommander2/Assets/Scripts/MainGame/CardViewPopup.cs:39-50 — 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) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:669— ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:669-681 | ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:684-695 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:175— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:175-190 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:225-236 — 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) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:878— ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:878-889 | ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:895-906 — 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) ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:666— ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:666-677 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:783-796 — 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) ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:177— ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:177-188 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:247-258 — 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) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/FigurePackPopup.cs:51— ImperialCommander2/Assets/Scripts/Screens/TitleScreen/FigurePackPopup.cs:51-62 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/TutorialPanel.cs:109-120 — 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.
Duplicated block (8 lines × 2) ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:134— ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:134-141 | ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:159-166 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:64— ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:64-71 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:62-69 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs` and `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:64` 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) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:519— ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:519-526 | ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:531-538 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:519` 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) ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:13— ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:13-20 | ImperialCommander2/Assets/Scripts/Saga/UI/HeroDashboard.cs:86-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:696— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:696-703 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:510-517 — 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 `ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:510` 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 (8 lines × 2) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:12— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:12-20 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/HighlightPrefab.cs:13-20 — 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 `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) ImperialCommander2/Assets/Scripts/Saga/UI/InputBox.cs:49— ImperialCommander2/Assets/Scripts/Saga/UI/InputBox.cs:49-56 | ImperialCommander2/Assets/Scripts/Saga/UI/PromptBox.cs:64-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×6
Edited copy of a member (6 corresponding lines) ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:32— ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:32-37 | ImperialCommander2/Assets/Scripts/MainGame/MissionTextBox.cs:39-46 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:167— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:167-172 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:217-222 — 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) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:170— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:170-175 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:191-196 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:308— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:308-314 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:239-244 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:317— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:317-323 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:255-260 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:326— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:326-332 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:247-252 — 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.
Duplicated block (6 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:324— ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:324-329 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:369-374 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:219— ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:219-224 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:230-235 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:820— ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:820-825 | ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:827-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:820` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:97— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:97-103 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:80-85 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 (6 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:681— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:681-698 | ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:726-731 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:78— ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:78-83 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:98-104 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyMethods: SagaEventManager ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs— TooManyMethods — 824 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods, declared across 2 files: Managers/MissionEventHandler.cs (32), Managers/SagaEventManager.cs (17). The bar is 30 methods; this is 19 over it, 1.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: SagaController ImperialCommander2/Assets/Scripts/Screens/SagaController.cs— TooManyMethods — 583 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: TitleController ImperialCommander2/Assets/Scripts/Screens/TitleController.cs— TooManyMethods — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 30 methods; this is 11 over it, 1.37× 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: CampaignManager ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs— TooManyMethods — 355 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DataStore ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs— TooManyMethods — 633 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 30 methods; this is 5 over it, 1.17× 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.
Duplicated block (13 lines × 2) ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:251— ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:251-263 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:272-284 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:251` 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) ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:412— ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:412-424 | ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:569-581 — 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 `ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:412` 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 (13 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:502— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:502-514 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:391-403 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:41— ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:41-53 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaHGPrefab.cs:54-66 — 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 `ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:41` 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) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:467— ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:467-480 | ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:411-423 — 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:53— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:53-59 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:41-47 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 (7 lines × 2) ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:145— ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:145-151 | ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:161-167 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:145` 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 before the matched lines, `ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:157` calls `Where`, `FirstOr` and `ImperialCommander2/Assets/Scripts/Saga/UI/HelpPanel.cs:144` 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) ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:190— ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:190-196 | ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:266-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:306— ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:306-312 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:352-358 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:306` 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) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:181— ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:181-187 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:586-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
IC1 · Incompleteness & stubs· Dead `#if false` region · ×5
Dead `#if false` region ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs:4— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Dead `#if false` region ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:90— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Dead `#if false` region ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:101— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Dead `#if false` region ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:118— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Dead `#if false` region ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:133— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Stateful shared instance: SagaSession ImperialCommander2/Assets/Scripts/GameCore/SagaSession.cs:7— `SagaSession` is not registered, but `DataStore` creates it and keeps it in the static `sagaSessionData`, 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 (campaignGUID; e.g. `campaignGUID` at line 135).
Stateful shared instance: DeploymentCard ImperialCommander2/Assets/Scripts/Models/DeploymentCard.cs:7— `DeploymentCard` is not registered, but `SagaController` creates it and keeps it in the static `DataStore.deployedHeroes`, 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 (woundTrackerValue, trackerNumbers; e.g. `woundTrackerValue` at line 173).
Stateful shared instance: SagaGameVars ImperialCommander2/Assets/Scripts/GameCore/SagaGameVars.cs:9— `SagaGameVars` is not registered, but the singleton `SagaSession` creates it and keeps it in `gameVars`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (dgOverridesAll, dgOverrides, countdownTimers; e.g. `dgOverridesAll` at line 100).
Stateful shared instance: DeploymentGroupOverride ImperialCommander2/Assets/Scripts/Saga/MissionModels/DeploymentGroupOverride.cs:7— `DeploymentGroupOverride` is not registered, but the singleton `SagaGameVars` creates it and keeps it in `dgOverridesAll`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (threatCost, modification, canReinforce, canRedeploy, canBeDefeated, useResetOnRedeployment; e.g. `threatCost` at line 79).
FileTooLong: GameCore/DataStore.cs ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs— FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 140 over it, 1.28× 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: Screens/SagaController.cs ImperialCommander2/Assets/Scripts/Screens/SagaController.cs— FileTooLong — 599 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 99 over it, 1.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: Screens/SagaSetup.cs ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs— FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 26 over it, 1.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Managers/MissionEventHandler.cs ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs— FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 16 over it, 1.03× 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.
MethodTooLong: TranslationController.InjectTranslationIntoMission ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:40— MethodTooLong — InjectTranslationIntoMission runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SagaAddHeroPanel.ShowContent ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:49— MethodTooLong — ShowContent runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: EventActionConverter.ReadJson ImperialCommander2/Assets/Scripts/Saga/Converters/EventActionConverter.cs:23— MethodTooLong — ReadJson runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.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.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×3
Edited copy of a member (18 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:71— ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:71-88 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:91-109 — 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) ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:22— ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:22-43 | ImperialCommander2/Assets/Scripts/Common/ClickHandlerForced.cs:22-39 — 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) ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:23— ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:23-40 | ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:46-66 — 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 (8 corresponding lines) · ×3
Edited copy of a member (8 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/MissionModels/Mission.cs:67— ImperialCommander2/Assets/Scripts/Saga/MissionModels/Mission.cs:67-74 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/Mission.cs:90-97 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:366— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:366-373 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:281-289 — 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) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/TileInfoPopup.cs:91— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/TileInfoPopup.cs:91-98 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/NewCampaignPanel.cs:155-162 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:517— ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:517-526 | ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:529-538 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:193— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:193-204 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:292-301 — 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) ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:152— ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:152-161 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:187-196 — 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.
Duplicated block (18 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:185— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:185-202 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:261-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:181` calls `ContainsCard`, `DisableMug` and `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:258` 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) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:705— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:705-722 | ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:778-795 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:705` 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 (18 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:208— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:208-225 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:305-322 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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. 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 (14 lines × 2) ImperialCommander2/Assets/Scripts/GlowEngine.cs:559— ImperialCommander2/Assets/Scripts/GlowEngine.cs:559-572 | ImperialCommander2/Assets/Scripts/GlowEngine.cs:581-594 — both copies are in the same file, so extract the 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) ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:123— ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:123-136 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaHGPrefab.cs:162-175 — 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 (14 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:394— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:394-407 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:434-447 — 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) ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:44— ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:44-55 | ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:73-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:314— ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:314-325 | ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:691-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:38— ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:38-49 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:92-114 — 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.
Low cohesion: SessionData (LCOM4 7) ImperialCommander2/Assets/Scripts/Models/SessionData.cs:11— SessionData's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MapEntityManager (LCOM4 5) ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:11— MapEntityManager'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: DeploymentCard (LCOM4 4) ImperialCommander2/Assets/Scripts/Models/DeploymentCard.cs:7— DeploymentCard's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Hotspot: ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:421— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SettingsPanel.Update at line 421. 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-05-16..2026-08-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-16 19:25:49 -04:00' --until='2026-08-14 19:25:49 -04:00' --full-history --no-merges -- ImperialCommander2/Assets/Scripts/Common/SettingsPanel.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: ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:902— ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in SagaSetup.InputFocusCheck at line 902. 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-05-16..2026-08-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-16 19:25:49 -04:00' --until='2026-08-14 19:25:49 -04:00' --full-history --no-merges -- ImperialCommander2/Assets/Scripts/Screens/SagaSetup.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.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:26— ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:26-53 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaHGPrefab.cs:31-66 — 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) ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:471— ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:471-498 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:504-531 — 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 (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) ImperialCommander2/Assets/Scripts/GameCore/SagaSession.cs:87— ImperialCommander2/Assets/Scripts/GameCore/SagaSession.cs:87-113 | ImperialCommander2/Assets/Scripts/Models/SessionData.cs:198-221 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:43— ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:43-66 | ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:72-95 — 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 copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) ImperialCommander2/Assets/Scripts/GlowEngine.cs:558— ImperialCommander2/Assets/Scripts/GlowEngine.cs:558-574 | ImperialCommander2/Assets/Scripts/GlowEngine.cs:580-596 — 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) ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:24— ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:24-40 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:23-41 — 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 (13 corresponding lines) · ×2
Edited copy of a member (13 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:22— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:22-34 | ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:801-815 — 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) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:794— ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:794-806 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:229-241 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:140— ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:140-155 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/NewCampaignPanel.cs:165-183 — 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) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:335— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:335-353 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:263-278 — 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 (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) ImperialCommander2/Assets/Scripts/GameCore/SagaSetupOptions.cs:43— ImperialCommander2/Assets/Scripts/GameCore/SagaSetupOptions.cs:43-57 | ImperialCommander2/Assets/Scripts/Models/SessionData.cs:125-141 — 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) ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:694— ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:694-708 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:711-726 — 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 (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:997— ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:997-1005 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:1008-1016 — 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) ImperialCommander2/Assets/Scripts/MainGame/RandomDeployPopup.cs:28— ImperialCommander2/Assets/Scripts/MainGame/RandomDeployPopup.cs:28-36 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionCardZoom.cs:29-39 — 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 (35 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:26— ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:26-60 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:24-58 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs` and `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (35 lines × 2) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:203— ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:203-237 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:342-376 — both copies are in the same file, so extract the 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 `ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:100— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:100-114 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:314-328 — 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 `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:100` 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 (15 lines × 2) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:216— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:216-230 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:280-294 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:182— ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:182-197 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:189-204 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs` and `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:475— ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:475-490 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:1117-1132 — 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 `ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:475` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:237— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:237-247 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:149-159 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:168— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:168-178 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:188-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 3) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:44— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:44-51 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:40-47 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:52-59 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. 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) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673— ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673-680 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:474-481 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/TileInfoPopup.cs:45-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:673` 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.
Swallowed exception (caught, then discarded) ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:51— `catch (Exception)` 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) ImperialCommander2/Assets/Scripts/Saga/UI/ErrorPanel.cs:80— `catch (Exception)` 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.
SagaAddHeroPanel.ShowContent (cyclomatic 58) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:49— SagaAddHeroPanel.ShowContent has cyclomatic complexity 58 (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.
MapEntityManager.Update (cyclomatic 39) ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:272— MapEntityManager.Update has cyclomatic complexity 39 (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.
FileManager.LoadCampaignPackage (cyclomatic 36) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:401— FileManager.LoadCampaignPackage has cyclomatic complexity 36 (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.
DynamicCardPrefab.InitCard (cyclomatic 35) ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:20— DynamicCardPrefab.InitCard has cyclomatic complexity 35 (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.
DataStore.SetDefaultPlayerPrefs (cyclomatic 31) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:1109— DataStore.SetDefaultPlayerPrefs has cyclomatic complexity 31 (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.
TranslationController.InjectTranslationIntoMission (cyclomatic 31) ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:40— TranslationController.InjectTranslationIntoMission has cyclomatic complexity 31 (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.
CampaignManager.InitUI (cyclomatic 29) ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:143— CampaignManager.InitUI 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.
MissionItemPrefab.Init (cyclomatic 28) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/MissionItemPrefab.cs:24— MissionItemPrefab.Init has cyclomatic complexity 28 (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.
SettingsPanel.OnToggle (cyclomatic 27) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:227— SettingsPanel.OnToggle has cyclomatic complexity 27 (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.
SettingsScreen.OnToggle (cyclomatic 27) ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:141— SettingsScreen.OnToggle has cyclomatic complexity 27 (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.
DeploymentPointProps.IsFilteredOut (cyclomatic 27) ImperialCommander2/Assets/Scripts/Saga/MissionModels/DeploymentPointProps.cs:40— DeploymentPointProps.IsFilteredOut has cyclomatic complexity 27 (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.
DynamicMissionCardPrefab.InitCard (cyclomatic 24) ImperialCommander2/Assets/Scripts/Common/DynamicMissionCardPrefab.cs:19— DynamicMissionCardPrefab.InitCard has cyclomatic complexity 24 (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.
SettingsPanel.Update (cyclomatic 23) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:421— SettingsPanel.Update has cyclomatic complexity 23 (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.
SagaSetup.InputFocusCheck (cyclomatic 21) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:902— SagaSetup.InputFocusCheck has cyclomatic complexity 21 (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.
DataStore.GetFuzzyDeployable (cyclomatic 20) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:954— DataStore.GetFuzzyDeployable 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.
MissionPicker.Update (cyclomatic 20) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPicker.cs:481— MissionPicker.Update 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.
SagaEventManager.MapManagement (cyclomatic 19) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:649— SagaEventManager.MapManagement has cyclomatic complexity 19 (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.
AddCampaignItemPopup.AddMission (cyclomatic 19) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:154— AddCampaignItemPopup.AddMission has cyclomatic complexity 19 (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.
MissionPicker.CreateBuiltInPickers (cyclomatic 19) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPicker.cs:216— MissionPicker.CreateBuiltInPickers has cyclomatic complexity 19 (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.
SagaModifyGroupsPanel.UpdateIgnoredImported (cyclomatic 19) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:204— SagaModifyGroupsPanel.UpdateIgnoredImported has cyclomatic complexity 19 (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.
EnemyActivationPopup.ShowSaga (cyclomatic 18) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:78— EnemyActivationPopup.ShowSaga 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.
CameraController.HandleKeyboardNavigation (cyclomatic 18) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:562— CameraController.HandleKeyboardNavigation 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.
SagaSetup.SetupCampaignMission (cyclomatic 18) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:231— SagaSetup.SetupCampaignMission 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.
SagaEventManager.RemoveGroup (cyclomatic 17) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:538— SagaEventManager.RemoveGroup 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.
SagaEventManager.RunChecks (cyclomatic 16) ImperialCommander2/Assets/Scripts/Saga/Managers/SagaEventManager.cs:154— SagaEventManager.RunChecks 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. This is NOT this file's highest cyclomatic complexity: SagaEventManager.ProcessEventAction (cyclomatic 32) 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.
SagaController.Update (cyclomatic 16) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:1111— SagaController.Update 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.
SagaAddHeroPanel.ShowContent (cognitive 126) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:49— SagaAddHeroPanel.ShowContent has cognitive complexity 126 (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.
TranslationController.InjectTranslationIntoMission (cognitive 85) ImperialCommander2/Assets/Scripts/LanguageControllers/TranslationController.cs:40— TranslationController.InjectTranslationIntoMission has cognitive complexity 85 (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.
FileManager.LoadCampaignPackage (cognitive 71) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:401— FileManager.LoadCampaignPackage has cognitive complexity 71 (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.
SettingsPanel.Update (cognitive 54) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:421— SettingsPanel.Update has cognitive complexity 54 (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.
DynamicCardPrefab.InitCard (cognitive 53) ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:20— DynamicCardPrefab.InitCard 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.
MapEntityManager.Update (cognitive 53) ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:272— MapEntityManager.Update 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.
CampaignManager.InitUI (cognitive 53) ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:143— CampaignManager.InitUI 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.
SettingsPanel.OnToggle (cognitive 42) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:227— SettingsPanel.OnToggle has cognitive complexity 42 (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.
SettingsScreen.OnToggle (cognitive 42) ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:141— SettingsScreen.OnToggle has cognitive complexity 42 (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.
SagaEventManager.MapManagement (cognitive 37) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:649— SagaEventManager.MapManagement has cognitive complexity 37 (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.
MissionPicker.CreateBuiltInPickers (cognitive 37) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPicker.cs:216— MissionPicker.CreateBuiltInPickers has cognitive complexity 37 (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.
SwipeInput.Update (cognitive 35) ImperialCommander2/Assets/Scripts/Common/SwipeInput.cs:24— SwipeInput.Update has cognitive complexity 35 (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.
MissionItemPrefab.Init (cognitive 34) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/MissionItemPrefab.cs:24— MissionItemPrefab.Init has cognitive complexity 34 (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.
SagaEventManager.CheckIfEventsTriggered (cognitive 33) ImperialCommander2/Assets/Scripts/Saga/Managers/SagaEventManager.cs:103— SagaEventManager.CheckIfEventsTriggered has cognitive complexity 33 (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.
SagaController.Update (cognitive 33) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:1111— SagaController.Update has cognitive complexity 33 (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.
MapEntityManager.ModifyEntityCoroutine (cognitive 31) ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:135— MapEntityManager.ModifyEntityCoroutine 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.
DataStore.SetDefaultPlayerPrefs (cognitive 30) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:1109— DataStore.SetDefaultPlayerPrefs has cognitive complexity 30 (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.
SagaEventManager.AddCampaignRewards (cognitive 30) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:886— SagaEventManager.AddCampaignRewards has cognitive complexity 30 (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.
SagaModifyGroupsPanel.UpdateIgnoredImported (cognitive 30) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:204— SagaModifyGroupsPanel.UpdateIgnoredImported has cognitive complexity 30 (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.
SagaCampaign.SetNextStoryMission (cognitive 29) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:269— SagaCampaign.SetNextStoryMission has cognitive complexity 29 (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.
SagaSetup.SetupCampaignMission (cognitive 29) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:231— SagaSetup.SetupCampaignMission has cognitive complexity 29 (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.
DynamicMissionCardPrefab.InitCard (cognitive 28) ImperialCommander2/Assets/Scripts/Common/DynamicMissionCardPrefab.cs:19— DynamicMissionCardPrefab.InitCard has cognitive complexity 28 (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.
EnemyActivationPopup.ShowSaga (cognitive 28) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:78— EnemyActivationPopup.ShowSaga has cognitive complexity 28 (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.
DeploymentPointProps.IsFilteredOut (cognitive 26) ImperialCommander2/Assets/Scripts/Saga/MissionModels/DeploymentPointProps.cs:40— DeploymentPointProps.IsFilteredOut has cognitive complexity 26 (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.
SagaEventManager.RemoveGroup (cognitive 25) ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:538— SagaEventManager.RemoveGroup 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.
AddCampaignItemPopup.AddMission (cognitive 25) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:154— AddCampaignItemPopup.AddMission 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.
CameraController.HandleKeyboardNavigation (cognitive 24) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:562— CameraController.HandleKeyboardNavigation has cognitive complexity 24 (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.
TranslatedModifyMapEntity.Validate (cognitive 23) ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:225— TranslatedModifyMapEntity.Validate 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.
DiceRoller.Show (cognitive 23) ImperialCommander2/Assets/Scripts/MainGame/DiceRoller.cs:23— DiceRoller.Show 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.
MissionPicker.Update (cognitive 23) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPicker.cs:481— MissionPicker.Update 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.
SagaModifyGroupsPanel.UpdateIgnored (cognitive 22) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:139— SagaModifyGroupsPanel.UpdateIgnored 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.
SagaDeploymentPopup.HandleLanding (cognitive 21) ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:218— SagaDeploymentPopup.HandleLanding has cognitive complexity 21 (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.
SagaSetup.InputFocusCheck (cognitive 21) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:902— SagaSetup.InputFocusCheck has cognitive complexity 21 (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.
MissionPicker.OnTiles (cognitive 21) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/MissionPicker.cs:405— MissionPicker.OnTiles has cognitive complexity 21 (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.
SagaModifyGroupsPanel.UpdateVillains (cognitive 21) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:280— SagaModifyGroupsPanel.UpdateVillains has cognitive complexity 21 (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.
DataStore.GetFuzzyDeployable (cognitive 20) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:954— DataStore.GetFuzzyDeployable has cognitive complexity 20 (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.
DeploymentCard.CreateCustomCard (cognitive 20) ImperialCommander2/Assets/Scripts/Models/DeploymentCard.cs:79— DeploymentCard.CreateCustomCard has cognitive complexity 20 (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.
SagaEventPopup.ParseCard (cognitive 20) ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:100— SagaEventPopup.ParseCard has cognitive complexity 20 (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.
SagaController.ParseMission (cognitive 20) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:322— SagaController.ParseMission has cognitive complexity 20 (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.
ContinueCampaignPanel.Show (cognitive 20) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ContinueCampaignPanel.cs:23— ContinueCampaignPanel.Show has cognitive complexity 20 (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.
GroupToggleContainer.OnChangeExpansion (cognitive 20) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/GroupToggleContainer.cs:66— GroupToggleContainer.OnChangeExpansion has cognitive complexity 20 (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.
SagaDGPrefab.OnDefeat (cognitive 18) ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:303— SagaDGPrefab.OnDefeat 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.
AddCampaignItemPopup.OnExpansionChanged (cognitive 18) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:325— AddCampaignItemPopup.OnExpansionChanged 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.
SagaController.OnEndRound (cognitive 18) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:765— SagaController.OnEndRound 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.
DataStore.CreateDeploymentHand (cognitive 17) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:685— DataStore.CreateDeploymentHand has cognitive complexity 17 (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.
FileManager.GetCampaignPackageList (cognitive 17) ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:592— FileManager.GetCampaignPackageList has cognitive complexity 17 (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.
SagaEventManager.DoEvent (cognitive 17) ImperialCommander2/Assets/Scripts/Saga/Managers/SagaEventManager.cs:300— SagaEventManager.DoEvent has cognitive complexity 17 (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.
SagaEventManager.QueueEndOfCurrentTurnEvents (cognitive 17) ImperialCommander2/Assets/Scripts/Saga/Managers/SagaEventManager.cs:336— SagaEventManager.QueueEndOfCurrentTurnEvents has cognitive complexity 17 (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.
SagaDeploymentPopup.HandleOnslaught (cognitive 17) ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:293— SagaDeploymentPopup.HandleOnslaught has cognitive complexity 17 (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.
CampaignStructure.GetTranslatedMission (cognitive 16) ImperialCommander2/Assets/Scripts/GameCore/CampaignStructure.cs:48— CampaignStructure.GetTranslatedMission 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.
SagaGameVars.SetCurrentCountdownUI (cognitive 16) ImperialCommander2/Assets/Scripts/GameCore/SagaGameVars.cs:194— SagaGameVars.SetCurrentCountdownUI 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.
CameraController.updateDoubleClick (cognitive 16) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:388— CameraController.updateDoubleClick 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.
SagaController.DoStartupTasks (cognitive 16) ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:466— SagaController.DoStartupTasks 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.
SagaModifyGroupsPanel.OnToggle (cognitive 16) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:351— SagaModifyGroupsPanel.OnToggle 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.
ClassTooLong: SagaSetup ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs— ClassTooLong — 514 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 114 over it, 1.29× 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.
Change coupling: SagaController.cs ↔ TitleController.cs ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:1— `ImperialCommander2/Assets/Scripts/Screens/SagaController.cs` and `ImperialCommander2/Assets/Scripts/Screens/TitleController.cs` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `480f0a7a` new settings window, new keyboard mapper; `9a3c928f` run a built-in mission from the command line, update .gitignore; `ef50ade3` can now modify custom campaign intro mission (at that commit the files were still `ImperialCommander2/Assets/Scripts/Saga/Managers/SagaController.cs` and `ImperialCommander2/Assets/Scripts/Title/TitleController.cs`) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:194— ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:194-220 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:722-763 — 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:303— ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:303-379 | REDACTED:137-226 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:44— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:44-118 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:37-98 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:121— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:121-164 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:101-139 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/Managers/WarpManager.cs:42— ImperialCommander2/Assets/Scripts/Saga/Managers/WarpManager.cs:42-100 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:758-817 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:140— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:140-202 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:281-346 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:356— ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:356-388 | ImperialCommander2/Assets/Scripts/LanguageControllers/TranslatedMission.cs:510-541 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 23+ corresponding lines) · ×1
Edited copies of one member (6 members, 23+ corresponding lines) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:61— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:61-83 | ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:85-107 | ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:109-131 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:88-114 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:116-142 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:144-170 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:466— ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs:466-496 | ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs:406-437 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:229— ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:229-251 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:254-280 — 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 (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:283— ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:283-302 | ImperialCommander2/Assets/Scripts/Screens/CampaignManager.cs:305-324 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:17— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:17-31 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/HighlightPrefab.cs:13-25 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:16-27 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:16-39 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:64— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:64-84 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:56-68 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:60-77 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:72-89 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:43— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:43-51 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DoorPrefab.cs:85-96 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:39-47 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:51-59 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) REDACTED:52— REDACTED:52-64 | REDACTED:70-81 | REDACTED:84-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:53— ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:53-66 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/Models/SagaCampaign.cs:69-82 — 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 copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) ImperialCommander2/Assets/Scripts/Saga/UI/InputBox.cs:48— ImperialCommander2/Assets/Scripts/Saga/UI/InputBox.cs:48-56 | ImperialCommander2/Assets/Scripts/Saga/UI/PromptBox.cs:63-71 | ImperialCommander2/Assets/Scripts/Saga/UI/TextBox.cs:46-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) ImperialCommander2/Assets/Scripts/Screens/TitleScreen/GroupToggleContainer.cs:26— ImperialCommander2/Assets/Scripts/Screens/TitleScreen/GroupToggleContainer.cs:26-32 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/HeroAllyToggleContainer.cs:25-33 | ImperialCommander2/Assets/Scripts/Screens/TitleScreen/MissionToggleContainer.cs:20-26 — 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, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:54— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:54-61 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DoorPrefab.cs:99-106 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:50-57 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:62-69 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:164— ImperialCommander2/Assets/Scripts/MainGame/DeploymentGroupManager.cs:164-174 | ImperialCommander2/Assets/Scripts/Saga/Managers/DeploymentManager.cs:199-209 — 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 (37–43 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:304— ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:304-340 | REDACTED:142-184 — 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 (57 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:95— ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:95-151 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:102-158 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs` and `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) ImperialCommander2/Assets/Scripts/Saga/Managers/WarpManager.cs:66— ImperialCommander2/Assets/Scripts/Saga/Managers/WarpManager.cs:66-93 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:783-810 — 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 `ImperialCommander2/Assets/Scripts/Saga/Managers/WarpManager.cs:66` 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 (26–28 lines × 2) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:151— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:151-178 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:302-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:151` 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, `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:181` calls `ContainsCard`, `DisableMug` and `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:328` 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 (25 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:250— ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:250-274 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:257-281 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs` and `ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22–24 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:64— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:64-87 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:49-70 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:64` 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–23 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:246— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:246-268 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:168-189 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:246` 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 (21–22 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:196— ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:196-216 | ImperialCommander2/Assets/Scripts/Screens/SagaController.cs:726-747 — 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 `ImperialCommander2/Assets/Scripts/MainGame/MainGameController.cs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–21 lines × 4) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:22— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:22-31 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:16-24 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:19-27 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:19-39 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:22` 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 first that the copies are not typed on the same thing: the declarations holding them bind `t` to `Terminal` in one and `Token` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DPointPrefab.cs:26` calls `EndTurnCleanup` and `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:33` 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 (21 lines × 2) ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:347— ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:347-367 | REDACTED:184-204 — 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 `ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:347` 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 (19 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:135— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:135-153 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:115-133 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:155` calls `PopFocus` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:134` 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 (19 lines × 6) ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:62— ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:62-80 | ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:86-104 | ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:110-128 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:92-110 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:120-138 | ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs:148-166 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/Common/SagaDGPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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–17 lines × 4) ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:234— ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:234-250 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:264-276 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:284-296 | ImperialCommander2/Assets/Scripts/Screens/TitleController.cs:749-761 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:100— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:100-113 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:165-178 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:314-327 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:181` calls `ContainsCard`, `DisableMug` and `ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:328` 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 (17 lines × 2) ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:27— ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:27-43 | ImperialCommander2/Assets/Scripts/Common/ClickHandlerForced.cs:23-39 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs` and `ImperialCommander2/Assets/Scripts/Common/ClickHandlerForced.cs` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:27` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ImperialCommander2/Assets/Scripts/Common/ClickHandler.cs:24` calls `GetInt` and `ImperialCommander2/Assets/Scripts/Common/ClickHandlerForced.cs:22` 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 (15 lines × 3) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:65— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:65-79 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:61-75 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:73-87 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 (14–15 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:271— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:271-285 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:197-210 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:282— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:282-295 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:158-170 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:282` 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 (9 lines × 7) ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Crate.cs:7— ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Crate.cs:7-15 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/DeploymentPoint.cs:7-15 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Door.cs:7-15 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/MapTile.cs:8-16 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/SpaceHighlight.cs:7-15 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Terminal.cs:7-15 | ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Token.cs:7-15 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Crate.cs` and `ImperialCommander2/Assets/Scripts/Saga/MissionModels/MapEntities/Terminal.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (10 lines × 3) ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:419— ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs:419-428 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaModifyGroupsPanel.cs:459-468 | ImperialCommander2/Assets/Scripts/Screens/SetupScreen/TileInfoPopup.cs:102-111 — 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. 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–11 lines × 2) ImperialCommander2/Assets/Scripts/LanguageControllers/MainLanguageController.cs:61— ImperialCommander2/Assets/Scripts/LanguageControllers/MainLanguageController.cs:61-71 | ImperialCommander2/Assets/Scripts/LanguageControllers/SetupLanguageController.cs:56-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.
Duplicated block (9 lines × 3) ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:286— ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:286-294 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:306-314 | ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:569-577 — 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 `ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:316` calls `GetMissionCard` and `ImperialCommander2/Assets/Scripts/Screens/SagaSetup.cs:296` 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 (7–8 lines × 2) ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:238— ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:238-245 | ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/AddCampaignItemPopup.cs:335-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 3) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:54— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:54-60 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:42-48 | ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:53-59 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 (6 lines × 8) ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:56— ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:56-61 | ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs:44-49 | ImperialCommander2/Assets/Scripts/MainGame/EnemyActivationPopup.cs:55-60 | ImperialCommander2/Assets/Scripts/MainGame/EventPopup.cs:26-31 | ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:22-28 | ImperialCommander2/Assets/Scripts/MainGame/RandomDeployPopup.cs:17-22 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaDeploymentPopup.cs:47-52 | ImperialCommander2/Assets/Scripts/Saga/UI/SagaEventPopup.cs:24-29 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs` and `ImperialCommander2/Assets/Scripts/Common/SettingsScreen.cs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 175 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 `ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `ImperialCommander2/Assets/Scripts/MainGame/RandomDeployPopup.cs:24` calls `ResetWheeler` and `ImperialCommander2/Assets/Scripts/MainGame/FamePopup.cs:29` 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 (7 lines × 4) ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:55— ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs:55-61 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/DoorPrefab.cs:100-106 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs:51-57 | ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TokenPrefab.cs:63-69 — before extracting anything, compare `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/CratePrefab.cs` and `ImperialCommander2/Assets/Scripts/Saga/MapEntityPrefabs/TerminalPrefab.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. 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.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×1
Guard cannot change the result — returns what the code already falls through to ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/ModifyCustomPropsPopup.cs:82— 1 guard above `return 0;` also returns `0`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked REDACTED:3— REDACTED 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.
async void method: PopulateList ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ImportCampaignPanel.cs:41— `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.
X2 · Cancellation propagation· Async method without CancellationToken · ×1
Async method without CancellationToken: PopulateList ImperialCommander2/Assets/Scripts/Screens/TitleScreen/ImportCampaignPanel.cs:41— No CancellationToken parameter — this work can't be stopped early once started.
Swallowed exception (empty catch) ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:379— 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.
X3 · Exception handling· Unguarded deserialized result under a catch list that cannot catch it · ×1
Unguarded deserialized result under a catch list that cannot catch it ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:434— `cards` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref.
X5 · Nullable reference types· Null guard scopes only part of the work it protects · ×1
Null guard scopes only part of the work it protects ImperialCommander2/Assets/Scripts/Saga/Managers/MissionEventHandler.cs:584— This method contradicts itself about `card`: line 555 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 584 then dereferences `card` as `card.id` AFTER the block has closed, where the guard no longer applies. A null `card` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `card` truly cannot be null by then, the guard above is misleading and should go.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/Common/Extensions.cs:27— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:237— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:277— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:291— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:292— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:306— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:307— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:321— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:322— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:376— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:386— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:387— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:415— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:416— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:459— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:460— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:493— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:502— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:524— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:525— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:530— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:531— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs:545— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:83— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging ImperialCommander2/Assets/Scripts/GameCore/FileManager.cs:213— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Commented-out code ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:35— 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 ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:64— 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 ImperialCommander2/Assets/Scripts/Common/ConfirmPopup.cs:65— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:82— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:106— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:130— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:136— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:137— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:139— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:145— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:147— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:151— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:152— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:158— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:160— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:162— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:165— 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 ImperialCommander2/Assets/Scripts/Common/DGPrefab.cs:191— 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 ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:114— 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 ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:119— 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 ImperialCommander2/Assets/Scripts/Common/DynamicCardPrefab.cs:122— 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 ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:80— 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 ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:83— 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 ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:146— 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 ImperialCommander2/Assets/Scripts/Common/HGPrefab.cs:147— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 6 significant file(s) lose their only recent owner: ImperialCommander2/Assets/Scripts/Screens/SagaController.cs, ImperialCommander2/Assets/Scripts/Screens/TitleController.cs, ImperialCommander2/Assets/Scripts/Common/SettingsPanel.cs, ImperialCommander2/Assets/Scripts/Saga/Managers/CameraController.cs, ImperialCommander2/Assets/Scripts/Saga/Managers/MapEntityManager.cs, ImperialCommander2/Assets/Scripts/Screens/SetupScreen/SagaAddHeroPanel.cs. Pair on, review, or document these before any departure.
No ADRs found ImperialCommander2/ProjectSettings/ProjectVersion.txt:1— 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 `ImperialCommander2/ProjectSettings/ProjectVersion.txt` makes this repository a deployable product (line 1).
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Blanket warning suppression ImperialCommander2/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:55— A `#pragma warning disable` with no error codes silences every warning for the rest of the file — hidden debt. Suppress specific codes with a justification instead.
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 `semgrep --config=auto` plus gitleaks for committed secrets — this tree has no MSBuild project file, so CodeQL's csharp pack (which traces a build) and NuGet security analyzers (which are referenced from a project) have nothing to attach to — 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 REDACTED:3— `REDACTED` 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`.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 0/1 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.
Nullable reference types not enabled everywhere — 0/226 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
Silent fallback default in catch REDACTED:345— `IsJSONValid` swallows `JsonReaderException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Outdated: com.unity.addressables — `com.unity.addressables` is resolved to 1.20.0 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 1.25.1 is published on the Unity registry. (1.25.1 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.collab-proxy — `com.unity.collab-proxy` is resolved to 2.0.4 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 2.5.2 is published on the Unity registry. (2.5.2 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.ide.rider — `com.unity.ide.rider` is resolved to 3.0.21 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 3.0.36 is published on the Unity registry. (3.0.36 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.ide.visualstudio — `com.unity.ide.visualstudio` is resolved to 2.0.22 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 2.0.23 is published on the Unity registry. (2.0.23 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.inputsystem — `com.unity.inputsystem` is resolved to 1.5.1 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 1.12.0 is published on the Unity registry. (1.12.0 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.nuget.newtonsoft-json — `com.unity.nuget.newtonsoft-json` is resolved to 3.0.2 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 3.2.2 is published on the Unity registry. (3.2.2 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.test-framework — `com.unity.test-framework` is resolved to 1.1.33 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 1.4.6 is published on the Unity registry. (1.4.6 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.timeline — `com.unity.timeline` is resolved to 1.4.8 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 1.8.7 is published on the Unity registry. (1.8.7 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Outdated: com.unity.toolchain.win-x86_64-linux-x86_64 — `com.unity.toolchain.win-x86_64-linux-x86_64` is resolved to 1.0.0 in the `packages-lock.json` beside `ImperialCommander2/Packages/manifest.json`, but 2.0.11 is published on the Unity registry. This crosses a major version, so expect API changes. (2.0.11 is the newest release compatible with Unity 2020.3, which is what this project targets — later releases require a newer editor.) Raise the version in `ImperialCommander2/Packages/manifest.json` and commit the updated packages-lock.json.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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 01a1e8e5-3680-7828-a42e-395ebe8d6717 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 15 · Warnings: 297 · Recommendations: 84 · Info: 9 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 09:44 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.