Public report — Playnite, published 5 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
394findings with an exact file:lineof 411 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
50/97dimensions across the health lenses118455 LoC · 15 projects — wide & deep
Executive summary
Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.
JosefNemec/Playnite carries serious risk (37%). Several issues below can materially affect reliability, security, or the cost of change and warrant near-term attention.
It is strongest in Architecture (93%) — the structure is clean and changes stay contained.
The area that most needs attention is Security (17%) — exposure to security and compliance incidents is elevated. Readiness (51%) is the next concern — operating, monitoring and recovering the system safely is harder.
Leadership focus, highest impact first: Encrypt sensitive data at rest (ASP.NET Core Data Protection /… (Data Protection); Protect endpoints by default-deny (Access Controls); Review each MD5/SHA1 use by what it protects (Web-Security Posture).
For scale: Large (~118,455 production lines); rebuilding it from scratch would take roughly ~2.4 person-years (~1–5 engineers). Approximate, ±~30%.
It builds on a genuinely strong Architecture foundation (93%); the priorities above are the highest-leverage way to bring the rest up to that level.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
This codebase represents roughly ~2.4 person-years of build effort (about ~€350,000 to rebuild). Its weakest lens is Security at 17% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.2) — service/app, high decision density × a 0.7× quality factor, at €60–95/h; indicative, ±~30%. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Protect endpoints by default-deny: [Authorize] + role/policy authorization, or imperative guard methods (throw-on-violation) called from every handler.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~2.4 person-years to rebuild), and its weakest lens is Security at 17%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.5/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 7.5/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
The top fix pays for itself · Medium · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 0.1–0.4 engineer-days every year, paid as drag on the ~1,204 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 90–1993 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 2–5% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 297 line(s) changed over a 90-day window ⇒ ~1,204/year · D1/D2/D4/D6 code quality: averaging 7.5/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 1993 months.
Architecture — bounded-context dependency graph
Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.
Architecture — module dependency matrix
74 modules, 235 dependencies — 3 dependency cycles, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
At a glance — Code Health · 54% · Adequate · gated by X1
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
A03:2021 — Injection
12
Medium
Roadmap
Begin by encrypting sensitive data at rest and managing keys in a vault, while ensuring all endpoints are protected by default-deny access controls and role-based authorization. Next, replace weak cryptographic hashes with stronger alternatives like SHA-256 or non-cryptographic hashes where appropriate to improve the web-security posture. Then, resolve the medium-priority static analysis findings, starting with the identified files. Finally, integrate a security analysis step into the CI pipeline to automatically detect and block security regressions.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Protect endpoints by default-deny: [Authorize] + role/policy authorization, or imperative guard methods (throw-on-violation) called from every handler.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
Add a SAST step to CI running what this repository's stack ships: CodeQL's csharp pack (it analyses VB.NET too), or a security analyzer package — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 46 of 50 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.5 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 50 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, 394 of 411 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
A clean run — every tool resolved and ran, and every applicable dimension was measured at full confidence. No scanner was unavailable, no analysis timed out or crashed, and nothing fell back to a degraded estimate.
When something does degrade — a missing scanner, a shallow clone, an LLM hiccup — it is named here explicitly and its exact cause recorded in diagnostics.md, never absorbed silently into the score.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
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.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (5): D19, D20, D21, D24, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
78 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was MetadataDownloader.DownloadMetadataAsync at 112. A further 11 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 DesktopCollectionView.GetRelevantDataDiffer at 33 — they are counted neither in the figure above nor in this dimension's score.
+ 73 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 MetadataDownloader.DownloadMetadataAsync (cyclomatic 112) finding(s) in Cyclomatic Complexity — start with MetadataDownloader.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 GameEditViewModel.EditingGame_PropertyChanged (cyclomatic 90) finding(s) in Cyclomatic Complexity — start with GameEditViewModelFieldChecks.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 GameEditViewModel.ConfirmDialog (cyclomatic 84) finding(s) in Cyclomatic Complexity — start with GameEditViewModel.cs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 141 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 MetadataDownloader.DownloadMetadataAsync (cognitive 233) finding(s) in Cognitive Complexity — start with MetadataDownloader.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 GameDatabase.MigrateNewDatabaseFormat (cognitive 190) finding(s) in Cognitive Complexity — start with GameDatabaseMigration.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 GameEditViewModel.ConfirmDialog (cognitive 145) finding(s) in Cognitive Complexity — start with GameEditViewModel.cs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.8 / 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 18 FileTooLong finding(s) in God Classes — start with SDL2.cs, TGASharpLib.cs, PlayniteSettings.cs. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 17 TooManyMethods finding(s) in God Classes — start with SDL2.cs, GameEditViewModel.cs, DesktopAppViewModel.cs. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 8 ClassTooLong finding(s) in God Classes — start with PlayniteSettings.cs, Game.cs, Scanner.cs. — One of this dimension's main actionable groups (8 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
+ 12 more group(s) — more in Appendix A; the complete list is findings.md.
✓ On the Gold path — maintain.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.9 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
210 test methods: 210 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.7 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
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.
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.
56 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is source/Playnite/Settings/PlayniteSettings.cs.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The Playnite project has a strong README with an engaging branding section (logo, Crowdin badge, Patreon link), features list, download guide, and links to FAQ, issues, community, privacy, and add-ons. The SDK readme is thin but points to the docs site. However, the documentation quality is low: only one README file covers the project's main product (Playnite itself), while all other files are clipped by the scanner mid-sentence ('All game library data is stored locally on your PC.') and no architecture or design doc exists among the visible files; this leaves a gap in the documented scope.
Improve Documentation Quality — currently 4.0/10. — The Playnite project has a strong README with an engaging branding section (logo, Crowdin badge, Patreon link), features list, download guide, and links to FAQ, issues, community, privacy, and add-ons. The SDK readme is thin but points to the docs site. However, the documentation quality is low: only one README file covers the project's main product (Playnite itself), while all other files are clipped by the scanner mid-sentence ('All game library data is stored locally on your PC.') and no architecture or design doc exists among the visible files; this leaves a gap in the documented scope.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
3 naming inconsistencies across 200 sampled symbols.
Inconsistent pluralization for collection-like properties. 'Genres' is correctly pluralized, while 'Serie' is singular, likely referring to a collection of series.
Inconsistent spelling of 'Behaviors' in the namespace/assembly name. 'FocusBahaviors' appears to be a typo (missing 'h' in Behaviors) or a misspelling of the standard 'Behaviors' used elsewhere in the codebase.
Typo in property name: 'Keywrods' is misspelled.
What to do
Resolve the 1 Inconsistent pluralization for collection-like properties. 'Genres' is… finding(s) in Naming Consistency. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Inconsistent spelling of 'Behaviors' in the namespace/assembly name.… finding(s) in Naming Consistency. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Typo in property name finding(s) in Naming Consistency. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D24 · Comment Value / 10Exemplary◐ Sampled · advisory
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
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).
Medium: regular-expression-dos · ×12source/Playnite.DesktopApp/ViewModels/GoogleImageDownloadViewModel.cs:297detected by semgrep finding
What to do
Resolve the 12 Medium finding(s) in Static Analysis (SAST) — start with Themes.cs (4), Extensions.cs (3), GoogleImageDownloadViewModel.cs. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d29_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.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.
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.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface member counts; fat-interface threshold (over 15 members) flagged per type. Deterministic, type-level.
`IGameDatabaseMain` declares 50 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — GameDatabase.cs:26
`IGameDatabase` declares 24 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IGameDatabase.cs:93
`IItemCollection<TItem>` declares 20 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IItemCollection.cs:134
`IPlayniteSettingsAPI` declares 28 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IPlayniteSettingsAPI.cs:79
`IDialogsFactory` declares 30 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IDialogsFactory.cs:360
`IMainViewAPI` declares 23 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IMainViewAPI.cs:50
`IPlayniteAPI` declares 22 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IPlayniteAPI.cs:15
`IWebView` declares 20 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — IWebView.cs:125
`IDataSerializer` declares 27 members. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — DataSerialization.cs:40
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
What to do
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS (UseHttpsRedirection / RequireHttpsMetadata) so data in transit is always encrypted.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
No [Authorize]/policies and no imperative guard methods (throw-on-violation) were found — endpoints may be unprotected.
What to do
Protect endpoints by default-deny: [Authorize] + role/policy authorization, or imperative guard methods (throw-on-violation) called from every handler.
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.
A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×25) — DesignNotificationsAPI.cs:39, DesignNotificationsAPI.cs:44, DesignNotificationsAPI.cs:49, …
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
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.
`ChooseImageFile` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — FullscreenDialogs.cs:175
`ChooseItemWithSearch` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — FullscreenDialogs.cs:180
`DesignNotificationsAPI` has 3 unfinished members out of 4 — a scaffolded type that was never implemented. — DesignNotificationsAPI.cs:12
`Add` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — DesignNotificationsAPI.cs:37, DesignNotificationsAPI.cs:42
`Remove` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignNotificationsAPI.cs:47
`DesignPlayniteAPI` has 12 unfinished members out of 12 — a scaffolded type that was never implemented. — DesignPlayniteAPI.cs:13
`AddCustomElementSupport` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:39
`CreateLogger` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — DesignPlayniteAPI.cs:44, DesignPlayniteAPI.cs:49
`ExpandGameVariables` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×3) — DesignPlayniteAPI.cs:54, DesignPlayniteAPI.cs:59, DesignPlayniteAPI.cs:94
`StartGame` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:64
`InstallGame` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:69
`UninstallGame` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:74
`AddSettingsSupport` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:79
`AddConvertersSupport` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:84
`GetConnectedControllers` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — DesignPlayniteAPI.cs:89
`InMemoryGameDatabase` has 23 unfinished members out of 30 — a scaffolded type that was never implemented. — InMemoryGameDatabase.cs:22
`ImportGame` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — InMemoryGameDatabase.cs:89, InMemoryGameDatabase.cs:94
`SetDatabasePath` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:99
`GetFileStoragePath` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:108
`GetFullFilePath` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:113
`AddFile` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — InMemoryGameDatabase.cs:118, InMemoryGameDatabase.cs:123
`RemoveFile` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:128
`GetFileAsImage` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:133
`CopyFile` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — InMemoryGameDatabase.cs:138
What to do
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
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 repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
34 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 14 of 15 project(s) that lack one — worth up to 1.9 pts.
Review the README against recent changes; refresh the parts that drifted.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/PlantUML/Mermaid diagram or architecture.md — the high-level shape isn't documented.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Only 6/7 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 7, 5 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
What to do
Extend structured logging across the projects you operate, and give the library ones a diagnostics seam instead — an `EventSource`/`ActivitySource` the host can subscribe to, or an optional logger on your options object — rather than taking a logging dependency on your consumers' behalf.
Consider OpenTelemetry tracing/metrics and a health-check endpoint for operability.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's csharp pack (it analyses VB.NET too), or a security analyzer package (or `semgrep --config=auto`, which runs on any language) as a CI step.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's csharp pack (it analyses VB.NET too), or a security analyzer package — or `semgrep --config=auto`, which runs on any language — 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 · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the library protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
No benchmark suite was found. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
What to do
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Raise allocation-aware density on the hot paths — currently 35 use(s) across 118,723 production line(s) (~0.3/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
Readiness · Performance — Whether asynchronous code keeps its host responsive — a library awaits with ConfigureAwait(false) (so it never captures and stalls the host's context) and avoids sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) that wastes threads and risks deadlock.
Method: Production-source scan: sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) counted everywhere, and — for a library with ≥5 awaits — the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
22 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock in a consumer with a synchronization context.
What to do
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult() in library code.
Other · Security — Transport security, security headers, secure cookies, input validation, middleware order and crypto hygiene (presence, not runtime).
MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. — FileSystem_Checksum.cs:39
No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. (−2.0 on this card.)
No UseHttpsRedirection/UseHsts and no reverse-proxy signal — transport security is unverified at the app layer. (−2.0 on this card.)
No ModelState/[ApiController]/FluentValidation signal — inbound payloads reach handlers unvalidated. (−2.0 on this card.)
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
Add security response headers (Content-Security-Policy, X-Frame-Options, X-Content-Type-Options) — defense in depth, even when a reverse proxy could set them.
Enforce HTTPS at the app layer (UseHttpsRedirection / UseHsts) — only skip this if a reverse proxy demonstrably terminates TLS.
Validate inbound models (ModelState/[ApiController]/FluentValidation) to reduce injection and bad-data risk.
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.
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×18) — BitmapExtensions.cs:325, FileSystem.cs:188, FileSystem.cs:209, …
`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. (×7) — FadeImage.xaml.cs:259, ObservablePowerStatus.cs:75, ObservablePowerStatus.cs:101, …
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.
Only 4/39 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. (×25) — Network.cs:12, PlayniteApplication.cs:1416, FadeImage.xaml.cs:259, …
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
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.
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. Deterministic.
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.
Not included — 47 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 — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AC7 A11y enforcement — Frontend below the scale floor (14 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
D11 Test Reliability — Test reliability not measured — no test run produced results
D14 License Compliance — license scan produced no result — the tool ran but its JSON output could not be parsed; the offline NuGet fallback resolved nothing
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Bounded contexts not declared
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — `dotnet list package --vulnerable` could not read this solution's dependency graph — it reported an error for at least one project and returned no package data at all (typically a packages.config / non-PackageReference project, which the command cannot read; classic .NET Framework projects are packages.config by default). No packages could be enumerated, so there was nothing to scan for NuGet CVEs — excluded rather than scored, because an unreadable dependency graph is not a clean one; migrate the project(s) to PackageReference to enable this scan
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .gitlab-ci.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, Jenkinsfile, .circleci); 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.
D38 OSV Dependency Vulnerabilities — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.
D39 IL Efficiency — The target did not build, so no IL was available to measure.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
D8 Code Coverage — Coverage not measured — analyzer environment
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this check looks for
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this check looks for
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P8 Schema migrations — no EF Core usage detected
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X5 Nullable reference types — no NRT-eligible projects
X6 Hand-rolled structured-format parsing — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
X7 Silent fallback defaults — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Issue — 2 finding(s)
D10 · Test Quality· No assertions (empty test) · ×2
No assertions (empty test): GetFileEntriesTest source/Tests/Playnite.Tests/CueSheetTests.cs:15— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): ViewSettingsTest source/Tests/Playnite.DesktopApp.Tests/MainViewAPITests.cs:19— Test method has an empty body — it asserts nothing and exercises no code.
TodoComment source/Playnite.DesktopApp/DesktopApplication.cs:240— // TODO test db path recovery — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:625— // TODO rewrite to something more sane — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:544— // TODO: Implement custom handling for default commands and solve this somehow globally. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite.FullscreenApp/Controls/FullscreenTilePanel.cs:219— // TODO: fix the desync. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite.FullscreenApp/Controls/Views/GameDetails.cs:81— // TODO handle properly in future via TODO from SelectedGame property
TodoComment source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:162— // TODO completely rework and decouple selected game from main view and game details — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/App/PlayniteApplication.cs:102— // TODO: remove after switch to .NET 5 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Common/Extensions/BitmapExtensions.cs:247— // TODO: Modify scaling to scale by both axies. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Common/Extensions/CloneObject.cs:175— // TODO Add support for lists — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Common/FileSystem.cs:369— // TODO Rework with proper symlinks handling with FileSystemInfo.ResolveLinkTarget — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Database/DatabaseExplorer.cs:73— // TODO: Rewrite this mess. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Database/GameDatabase.cs:466— // TODO: Remove this, we should only allow path to be set during instantiation. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/DateTimes.cs:100— // TODO: handle properly — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Extensions/GameExtensions.cs:184— // TODO rework this whole mess into something better and more maintainable :| — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Plugins/ExtensionFactory.cs:492— // TODO: Unload assembly once Playnite switches to .NET Core — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/SDL2.cs:142— /* TODO: This #ifdef is only here because the equivalent
* .NET 2.0 constructor appears to be less efficient?
* Here's the pretty version, maybe steal this instead:
*
string result = new string(
(sbyte*) s, // Also, why sbyte???
0,
(int) (ptr - (byte*) s),
System.Text.Encoding.UTF8
);
* See the CoreCLR source for more info.
* -flibit
*/ — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/SelectableItem.cs:81— // TODO: refactor this and merge it with NamedObject and SelectableItem — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/SelectableItem.cs:101— // TODO: refactor this and merge it with NamedObject and SelectableNamedObject — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/ViewModels/SearchViewModel.cs:226— // TODO replace this in future by exposing GamesCollectionViewEntry to SDK and let plugins create them directly. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/ViewModels/SearchViewModel.cs:704— // TODO definitely could use some improvements for better fuzzy results. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Playnite/Windows/WindowPositionHandler.cs:145— // TODO: this needs complete rework when per display DPI support is enabled in P11. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Tests/Playnite.DesktopApp.Tests/ViewModels/DatabaseFieldsManagerViewModelTests.cs:82— // TODO add file test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment source/Tests/Playnite.Tests/App/UpdateTests.cs:29— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FileTooLong: Playnite/SDL2.cs source/Playnite/SDL2.cs:0— FileTooLong — 5464 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Common/TGASharpLib.cs source/Playnite/Common/TGASharpLib.cs:0— FileTooLong — 2972 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Settings/PlayniteSettings.cs source/Playnite/Settings/PlayniteSettings.cs:0— FileTooLong — 1507 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Models/Game.cs source/PlayniteSDK/Models/Game.cs:0— FileTooLong — 1033 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Playnite/GamesEditor.cs source/Playnite/GamesEditor.cs:0— FileTooLong — 983 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: App/PlayniteApplication.cs source/Playnite/App/PlayniteApplication.cs:0— FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: OldModels/Ver2.cs source/Playnite/Database/OldModels/Ver2.cs:0— FileTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Emulators/Scanner.cs source/Playnite/Emulators/Scanner.cs:0— FileTooLong — 851 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Database/GameDatabase.cs source/Playnite/Database/GameDatabase.cs:0— FileTooLong — 849 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/GameEditViewModel.cs source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:0— FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Settings/FilterSettings.cs source/Playnite/Settings/FilterSettings.cs:0— FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/DesktopAppViewModel.cs source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:0— FileTooLong — 760 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/GameEditViewModelFieldChecks.cs source/Playnite.DesktopApp/ViewModels/GameEditViewModelFieldChecks.cs:0— FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/FullscreenAppViewModel.cs source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:0— FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Database/DatabaseExplorer.cs source/Playnite/Database/DatabaseExplorer.cs:0— FileTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/MainViewModelBase.cs source/Playnite/ViewModels/MainViewModelBase.cs:0— FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ViewModels/SearchViewModel.cs source/Playnite/ViewModels/SearchViewModel.cs:0— FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Views/GameOverview.cs source/Playnite.DesktopApp/Controls/Views/GameOverview.cs:0— FileTooLong — 507 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
TooManyMethods: SDL source/Playnite/SDL2.cs:0— TooManyMethods — 4764 significant lines (blank, comment-only and punctuation-only lines excluded), 790 methods. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: GameEditViewModel source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:0— TooManyMethods — 1992 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods, declared across 3 files: ViewModels/GameEditViewModel.cs (74), ViewModels/GameEditViewModelMetadata.cs (15), ViewModels/GameEditViewModelFieldChecks.cs (3). 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: DesktopAppViewModel source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:0— TooManyMethods — 1111 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods, declared across 4 files: ViewModels/DesktopAppViewModel.cs (63), ViewModels/DesktopAppViewModel_Sidebar.cs (3), ViewModels/DesktopAppViewModel_Commands.cs (1), ViewModels/DesktopAppViewModel_TopPanel.cs (1). 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: GameDatabase source/Playnite/Database/GameDatabase.cs:0— TooManyMethods — 793 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods, declared across 2 files: Database/GameDatabase.cs (57), Database/GameDatabase_Filters.cs (6). 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: FullscreenAppViewModel source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:0— TooManyMethods — 845 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods, declared across 2 files: ViewModels/FullscreenAppViewModel.cs (47), ViewModels/FullscreenAppViewModel_Commands.cs (1). 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: GamesEditor source/Playnite/GamesEditor.cs:0— TooManyMethods — 929 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlayniteApplication source/Playnite/App/PlayniteApplication.cs:0— TooManyMethods — 907 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FileSystem source/Playnite/Common/FileSystem.cs:0— TooManyMethods — 280 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods, declared across 2 files: Common/FileSystem.cs (35), Common/FileSystem_Checksum.cs (5). The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ItemCollection source/Playnite/Database/Collections/ItemCollection.cs:0— TooManyMethods — 300 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainViewModelBase source/Playnite/ViewModels/MainViewModelBase.cs:0— TooManyMethods — 552 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FullscreenTilePanel source/Playnite.FullscreenApp/Controls/FullscreenTilePanel.cs:0— TooManyMethods — 404 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Plugin source/PlayniteSDK/Plugins/Plugin.cs:0— TooManyMethods — 81 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FilterMatcher source/Playnite/Database/GameDatabase_Filters.cs:0— TooManyMethods — 159 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TGA source/Playnite/Common/TGASharpLib.cs:0— TooManyMethods — 814 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FilterSettings source/Playnite/Settings/FilterSettings.cs:0— TooManyMethods — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExtensionFactory source/Playnite/Plugins/ExtensionFactory.cs:0— TooManyMethods — 422 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InMemoryGameDatabase source/Playnite/Database/InMemoryGameDatabase.cs:0— TooManyMethods — 105 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Medium: regular-expression-dos source/Playnite.DesktopApp/ViewModels/GoogleImageDownloadViewModel.cs:297— When using `System.Text.RegularExpressions` to process untrusted input, pass a timeout. A malicious user can provide input to `RegularExpressions` that abuses the backtracking behaviour of this regular expression engine. This will lead to excessive CPU usage, causing a Denial-of-Service attack. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: regular-expression-dos source/Playnite.DesktopApp/ViewModels/SettingsViewModel.cs:637— When using `System.Text.RegularExpressions` to process untrusted input, pass a timeout. A malicious user can provide input to `RegularExpressions` that abuses the backtracking behaviour of this regular expression engine. This will lead to excessive CPU usage, causing a Denial-of-Service attack. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: unsafe-path-combine source/Playnite/Localization.cs:117— String argument path is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tests/Playnite.Tests/_TestTools/PlayniteTests.cs:54— String argument directory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Extensions.cs:101— String argument directory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Extensions.cs:129— String argument directory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Extensions.cs:150— String argument directory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Themes.cs:335— String argument themeDirectory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Themes.cs:378— String argument themeDirectory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Themes.cs:429— String argument outDir is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Toolbox/Themes.cs:430— String argument outDir is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine source/Tools/Playnite.Utilities/DatParser.cs:438— String argument outputDir is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
BarePragmaDisable source/Playnite.DesktopApp/DesktopApplication.cs:93— #pragma warning disable CS4014 — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel_Commands.cs:134— #pragma warning disable CS4014 — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/Playnite.DesktopApp/ViewModels/InstalledGamesViewModel.cs:280— #pragma warning disable CS4014 — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/Playnite/API/DatabaseAPI.cs:20— #pragma warning disable CS0067 — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/Playnite/Database/InMemoryGameDatabase.cs:68— #pragma warning disable CS0067 — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/Playnite/Controllers/GenericGameController.cs:24— #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/PlayniteSDK/Events/ApplicationEvents.cs:10— #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/PlayniteSDK/IDialogsFactory.cs:10— #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/PlayniteSDK/IWebView.cs:12— #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
BarePragmaDisable source/PlayniteSDK/WebViewModels.cs:7— #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — the disable has no matching restore, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
Low cohesion: Plugin (LCOM4 8) source/PlayniteSDK/Plugins/Plugin.cs:168— Plugin's methods form 8 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: PlayniteSettings (LCOM4 7) source/Playnite/Settings/PlayniteSettings.cs:261— PlayniteSettings's methods form 7 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: FullscreenAppViewModel (LCOM4 6) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:35— FullscreenAppViewModel's methods form 6 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: Game (LCOM4 6) source/PlayniteSDK/Models/Game.cs:188— Game's methods form 6 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: DatabaseFieldsManagerViewModel (LCOM4 5) source/Playnite.DesktopApp/ViewModels/DatabaseFieldsManagerViewModel.cs:23— DatabaseFieldsManagerViewModel's methods form 5 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: DesktopAppViewModel (LCOM4 5) source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:40— DesktopAppViewModel's methods form 5 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: ExtensionFactory (LCOM4 5) source/Playnite/Plugins/ExtensionFactory.cs:65— ExtensionFactory's methods form 5 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: EmulatorsViewModel (LCOM4 4) source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:25— EmulatorsViewModel's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: PlayniteApiRoot (LCOM4 4) source/Playnite/API/PlayniteAPI.cs:38— PlayniteApiRoot's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
Low cohesion: WindowBase (LCOM4 4) source/Playnite/Controls/WindowBase.cs:46— WindowBase's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
ClassTooLong: PlayniteSettings source/Playnite/Settings/PlayniteSettings.cs:0— ClassTooLong — 1322 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Game source/PlayniteSDK/Models/Game.cs:0— ClassTooLong — 938 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GameScanner source/Playnite/Emulators/Scanner.cs:0— ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatabaseExplorer source/Playnite/Database/DatabaseExplorer.cs:0— ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GameOverview source/Playnite.DesktopApp/Controls/Views/GameOverview.cs:0— ClassTooLong — 484 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatabaseFieldsManagerViewModel source/Playnite.DesktopApp/ViewModels/DatabaseFieldsManagerViewModel.cs:0— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GenericPlayController source/Playnite/Controllers/GenericGameController.cs:0— ClassTooLong — 461 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AddonsViewModel source/Playnite.DesktopApp/ViewModels/AddonsViewModel.cs:0— ClassTooLong — 449 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods, declared across 2 files: ViewModels/AddonsViewModel.cs (11), ViewModels/AddonsViewModel_Online.cs (3). 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.
Duplicated block (14 lines × 2) source/Playnite/Controllers/GenericGameController.cs:566— source/Playnite/Controllers/GenericGameController.cs:566-579 | source/Playnite/Controllers/GenericGameController.cs:600-613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Controllers/GenericGameController.cs:566` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) source/PlayniteSDK/Extensions/ListExtensions.cs:200— source/PlayniteSDK/Extensions/ListExtensions.cs:200-213 | source/PlayniteSDK/Extensions/ListExtensions.cs:266-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/PlayniteSDK/Extensions/ListExtensions.cs:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:491— source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:491-504 | source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:507-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:491` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:127— source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:127-140 | source/Playnite.FullscreenApp/Controls/FilterEnumListSelection.cs:132-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) source/Playnite.DesktopApp/Controls/FilterStringSelectionBox.cs:88— source/Playnite.DesktopApp/Controls/FilterStringSelectionBox.cs:88-101 | source/Playnite.FullscreenApp/Controls/FilterStringListSelection.cs:116-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/FilterStringSelectionBox.cs:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:54— source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:54-67 | source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:103-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:72— source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:72-85 | source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:121-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) source/Playnite.DesktopApp/Controls/FilterSelectionBox.cs:154— source/Playnite.DesktopApp/Controls/FilterSelectionBox.cs:154-167 | source/Playnite.FullscreenApp/Controls/FilterDbItemtSelection.cs:118-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/FilterSelectionBox.cs:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) source/Playnite.DesktopApp/DesktopCollectionView.cs:576— source/Playnite.DesktopApp/DesktopCollectionView.cs:576-588 | source/Playnite.FullscreenApp/FullscreenCollectionView.cs:87-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/DesktopCollectionView.cs:576` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) source/Playnite.DesktopApp/ViewModels/DesignData/DesignMainViewModel.cs:66— source/Playnite.DesktopApp/ViewModels/DesignData/DesignMainViewModel.cs:66-78 | source/Playnite.FullscreenApp/ViewModels/DesignData/DesignMainViewModel.cs:74-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:1611— source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:1611-1623 | source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:422-434 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:1611` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:1002— source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:1002-1014 | source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:1165-1177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:1002` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) source/Playnite/Backup.cs:283— source/Playnite/Backup.cs:283-291 | source/Playnite/Backup.cs:324-332 — both copies are in the same file, so extract the 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) source/Playnite/MenuItems.cs:269— source/Playnite/MenuItems.cs:269-277 | source/Playnite/MenuItems.cs:297-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/MenuItems.cs:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) source/Playnite/Settings/PlayniteSettings.cs:2339— source/Playnite/Settings/PlayniteSettings.cs:2339-2347 | source/Playnite/Settings/PlayniteSettings.cs:2382-2390 — both copies are in the same file, so extract the 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) source/Playnite.DesktopApp/Controls/ComboBoxList.cs:130— source/Playnite.DesktopApp/Controls/ComboBoxList.cs:130-138 | source/Playnite.DesktopApp/Controls/FilterSelectionBox.cs:36-44 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/ComboBoxList.cs:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:70— source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:70-78 | source/Playnite.FullscreenApp/Controls/FilterEnumListSelection.cs:76-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Controls/FilterEnumSelectionBox.cs:70` 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.
Change coupling: DesignPlayniteAPI.cs ↔ PlayniteAPI.cs source/Playnite/API/DesignData/DesignPlayniteAPI.cs— `source/Playnite/API/DesignData/DesignPlayniteAPI.cs` and `source/Playnite/API/PlayniteAPI.cs` change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking.
Change coupling: ExtensionFactory.cs ↔ PowerShellScript.cs source/Playnite/Plugins/ExtensionFactory.cs— `source/Playnite/Plugins/ExtensionFactory.cs` and `source/Playnite/Scripting/PowerShell/PowerShellScript.cs` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking.
Change coupling: GameDetails.cs ↔ Main.cs source/Playnite.FullscreenApp/Controls/Views/GameDetails.cs— `source/Playnite.FullscreenApp/Controls/Views/GameDetails.cs` and `source/Playnite.FullscreenApp/Controls/Views/Main.cs` change together 50% of the time (10 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
Change coupling: Filters.cs ↔ FiltersAdditional.cs source/Playnite.FullscreenApp/Controls/Views/Filters.cs— `source/Playnite.FullscreenApp/Controls/Views/Filters.cs` and `source/Playnite.FullscreenApp/Controls/Views/FiltersAdditional.cs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
Duplicated block (18 lines × 2) source/Playnite/ObservablePowerStatus.cs:76— source/Playnite/ObservablePowerStatus.cs:76-93 | source/Playnite/ObservableTime.cs:33-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/ObservablePowerStatus.cs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) source/Playnite.DesktopApp/DesktopApplication.cs:375— source/Playnite.DesktopApp/DesktopApplication.cs:375-392 | source/Playnite.FullscreenApp/FullscreenApplication.cs:280-297 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:206— source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:206-223 | source/Playnite.FullscreenApp/Windows/TextInputWindow.xaml.cs:151-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:352— source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:352-369 | source/Playnite.FullscreenApp/Windows/MessageBoxWindow.xaml.cs:245-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/Windows/MessageBoxWindow.xaml.cs:352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
FixmeComment source/Playnite/SDL2.cs:7018— // FIXME: I'd rather this somehow be private... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment source/Playnite/SDL2.cs:7026— // FIXME: I'd rather this somehow be private... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment source/Playnite/SDL2.cs:8666— // FIXME: I wish these weren't public... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (17 lines × 2) source/Playnite/Database/OldModels/Ver2.cs:89— source/Playnite/Database/OldModels/Ver2.cs:89-105 | source/PlayniteSDK/Models/DatabaseObject.cs:54-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) source/Playnite/App/PlayniteApplication.cs:1605— source/Playnite/App/PlayniteApplication.cs:1605-1621 | source/Playnite/App/PlayniteApplication.cs:1649-1665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/App/PlayniteApplication.cs:1605` 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 (17 lines × 2) source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:380— source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:380-396 | source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:406-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:380` 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) source/PlayniteSDK/Extensions/ListExtensions.cs:118— source/PlayniteSDK/Extensions/ListExtensions.cs:118-132 | source/PlayniteSDK/Extensions/ListExtensions.cs:149-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/PlayniteSDK/Extensions/ListExtensions.cs:118` 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 (15 lines × 2) source/Playnite.DesktopApp/ViewModels/GameDetailsViewModel.cs:104— source/Playnite.DesktopApp/ViewModels/GameDetailsViewModel.cs:104-118 | source/Playnite.FullscreenApp/ViewModels/GameDetailsViewModel.cs:47-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/GameDetailsViewModel.cs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:396— source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:396-410 | source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:947-961 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) source/Playnite/Database/Collections/RegionsCollection.cs:60— source/Playnite/Database/Collections/RegionsCollection.cs:60-69 | source/Playnite/Database/Collections/RegionsCollection.cs:113-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Database/Collections/RegionsCollection.cs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) source/Playnite/Database/Collections/PlatformsCollection.cs:133— source/Playnite/Database/Collections/PlatformsCollection.cs:133-142 | source/Playnite/Database/Collections/PlatformsCollection.cs:186-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Database/Collections/PlatformsCollection.cs:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) source/PlayniteSDK/Models/Emulator.cs:765— source/PlayniteSDK/Models/Emulator.cs:765-774 | source/PlayniteSDK/Models/Emulator.cs:789-798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/PlayniteSDK/Models/Emulator.cs:765` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) source/Playnite/Converters/ListToStringConverter.cs:146— source/Playnite/Converters/ListToStringConverter.cs:146-161 | source/Playnite/Converters/ListToStringConverter.cs:195-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Converters/ListToStringConverter.cs:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:266— source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:266-281 | source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:288-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:266` 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 (12 lines × 2) source/Playnite/Themes.cs:241— source/Playnite/Themes.cs:241-252 | source/Playnite/Themes.cs:266-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Themes.cs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:369— source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:369-380 | source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:393-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:369` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) source/Playnite/Controllers/GenericGameController.cs:290— source/Playnite/Controllers/GenericGameController.cs:290-300 | source/Playnite/Controllers/GenericGameController.cs:306-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite/Controllers/GenericGameController.cs:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) source/Playnite.DesktopApp/ViewModels/AddonsViewModel.cs:397— source/Playnite.DesktopApp/ViewModels/AddonsViewModel.cs:397-407 | source/Playnite.DesktopApp/ViewModels/LibraryIntegrationsViewModel.cs:133-143 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `source/Playnite.DesktopApp/ViewModels/AddonsViewModel.cs:397` 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.
Off the main sequence: Playnite.SDK — Playnite.SDK: abstractness 0.23, instability 0.00, distance 0.77 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: Playnite — Playnite: abstractness 0.04, instability 0.20, distance 0.76 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
MetadataDownloader.DownloadMetadataAsync (cyclomatic 112) source/Playnite/Metadata/MetadataDownloader.cs:311— MetadataDownloader.DownloadMetadataAsync has cyclomatic complexity 112 (threshold 15). Most of this is not in the body itself: 1 of the 112 points is its own statement and the rest belongs to one function literal inside it that branches (line 318). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
GameEditViewModel.EditingGame_PropertyChanged (cyclomatic 90) source/Playnite.DesktopApp/ViewModels/GameEditViewModelFieldChecks.cs:849— GameEditViewModel.EditingGame_PropertyChanged has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameEditViewModel.ConfirmDialog (cyclomatic 84) source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:525— GameEditViewModel.ConfirmDialog has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameDatabase.MigrateNewDatabaseFormat (cyclomatic 74) source/Playnite/Database/GameDatabaseMigration.cs:22— GameDatabase.MigrateNewDatabaseFormat has cyclomatic complexity 74 (threshold 15). Of this number, 55 points are the body's own statements and 19 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game.GetDifferences (cyclomatic 65) source/PlayniteSDK/Models/Game.cs:2032— Game.GetDifferences has cyclomatic complexity 65 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TGA.LoadFunc (cyclomatic 57) source/Playnite/Common/TGASharpLib.cs:5298— TGA.LoadFunc has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game.CopyDiffTo (cyclomatic 55) source/PlayniteSDK/Models/Game.cs:1750— Game.CopyDiffTo has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteApplication.PlayniteApplication.ctor (cyclomatic 54) source/Playnite/App/PlayniteApplication.cs:92— PlayniteApplication.PlayniteApplication.ctor has cyclomatic complexity 54 (threshold 15). Of this number, 52 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameScanner.ScanDirectoryBase (cyclomatic 51) source/Playnite/Emulators/Scanner.cs:693— GameScanner.ScanDirectoryBase has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TGA.ToBitmapFunc (cyclomatic 48) source/Playnite/Common/TGASharpLib.cs:5681— TGA.ToBitmapFunc has cyclomatic complexity 48 (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.
FullscreenAppViewModel.InitializeCommands (cyclomatic 47) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:45— FullscreenAppViewModel.InitializeCommands has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 100, 56, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
GameEditViewModel.GetDisplayDiffFields (cyclomatic 46) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:56— GameEditViewModel.GetDisplayDiffFields has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatabaseExplorer.LoadValues (cyclomatic 43) source/Playnite/Database/DatabaseExplorer.cs:723— DatabaseExplorer.LoadValues has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TGA.CheckAndUpdateOffsets (cyclomatic 42) source/Playnite/Common/TGASharpLib.cs:4799— TGA.CheckAndUpdateOffsets has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MetadataDownloader.ProcessField (cyclomatic 38) source/Playnite/Metadata/MetadataDownloader.cs:136— MetadataDownloader.ProcessField has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DesktopCollectionView.SetViewDescriptions (cyclomatic 37) source/Playnite.DesktopApp/DesktopCollectionView.cs:187— DesktopCollectionView.SetViewDescriptions has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GameDatabase.ImportGames (cyclomatic 35) source/Playnite/Database/GameDatabase.cs:1205— GameDatabase.ImportGames has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GamesEditor.PlayGame (cyclomatic 35) source/Playnite/GamesEditor.cs:189— GamesEditor.PlayGame has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GameScanner.Scan (cyclomatic 32) source/Playnite/Emulators/Scanner.cs:185— GameScanner.Scan has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FilterSettings.ClearFilters (cyclomatic 32) source/Playnite/Settings/FilterSettings.cs:956— FilterSettings.ClearFilters has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DatabaseExplorer.ApplyFilter (cyclomatic 31) source/Playnite/Database/DatabaseExplorer.cs:592— DatabaseExplorer.ApplyFilter has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FilterSettings.ApplyFilter (cyclomatic 31) source/Playnite/Settings/FilterSettings.cs:1221— FilterSettings.ApplyFilter has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GamesGridView.GetColumn (cyclomatic 31) source/Playnite.DesktopApp/Controls/GamesGridView.xaml.cs:208— GamesGridView.GetColumn has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GamesEditor.Controllers_Stopped (cyclomatic 30) source/Playnite/GamesEditor.cs:1416— GamesEditor.Controllers_Stopped has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameTools.GetMultiGameEditObject (cyclomatic 30) source/Playnite/GameTools.cs:28— GameTools.GetMultiGameEditObject has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FilterMatcher.Match (cyclomatic 29) source/Playnite/Database/GameDatabase_Filters.cs:60— FilterMatcher.Match has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MetadataComparisonViewModel.ConfirmDialog (cyclomatic 29) source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:264— MetadataComparisonViewModel.ConfirmDialog has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Backup.BackupData (cyclomatic 28) source/Playnite/Backup.cs:73— Backup.BackupData has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MenuItems.GetSearchGameMenuItems (cyclomatic 28) source/Playnite/MenuItems.cs:164— MenuItems.GetSearchGameMenuItems has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TGA.LoadFunc (cyclomatic 28) source/Playnite/Common/TGASharpLib.cs:5138— TGA.LoadFunc has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteApplication.Application_Startup (cyclomatic 27) source/Playnite/App/PlayniteApplication.cs:599— PlayniteApplication.Application_Startup has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CloneObject.CopyProperties (cyclomatic 26) source/Playnite/Common/Extensions/CloneObject.cs:113— CloneObject.CopyProperties has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameEditViewModel.LoadNewMetadata (cyclomatic 26) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:252— GameEditViewModel.LoadNewMetadata has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ItemsControlEx.ItemsControlEx_PreviewKeyDown (cyclomatic 26) source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:38— ItemsControlEx.ItemsControlEx_PreviewKeyDown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Main.OnApplyTemplate (cyclomatic 26) source/Playnite.FullscreenApp/Controls/Views/Main.cs:226— Main.OnApplyTemplate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FullscreenAppViewModel.Fullscreen_PropertyChanged (cyclomatic 26) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:579— FullscreenAppViewModel.Fullscreen_PropertyChanged has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Backup.RestoreBackup (cyclomatic 25) source/Playnite/Backup.cs:212— Backup.RestoreBackup has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatabaseFilter.UpdateAllCollections (cyclomatic 25) source/Playnite/Database/DatabaseFilter.cs:375— DatabaseFilter.UpdateAllCollections has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GamesEditor.CalculateGameSize (cyclomatic 25) source/Playnite/GamesEditor.cs:566— GamesEditor.CalculateGameSize has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImageSourceManager.GetImage (cyclomatic 25) source/Playnite/ImageSourceManager.cs:160— ImageSourceManager.GetImage has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GenericPlayController.Start (cyclomatic 25) source/Playnite/Controllers/GenericGameController.cs:481— GenericPlayController.Start has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BitmapExtensions.BitmapFromStream (cyclomatic 24) source/Playnite/Common/Extensions/BitmapExtensions.cs:249— BitmapExtensions.BitmapFromStream has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteApplication.PipeService_CommandExecuted (cyclomatic 23) source/Playnite/App/PlayniteApplication.cs:780— PlayniteApplication.PipeService_CommandExecuted has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteSettings.LoadSettings (cyclomatic 22) source/Playnite/Settings/PlayniteSettings.cs:2352— PlayniteSettings.LoadSettings has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThemeManager.ApplyTheme (cyclomatic 22) source/Playnite/Themes.cs:92— ThemeManager.ApplyTheme has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteApplication.CurrentDomain_UnhandledException (cyclomatic 21) source/Playnite/App/PlayniteApplication.cs:496— PlayniteApplication.CurrentDomain_UnhandledException has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TGA.SaveFunc (cyclomatic 21) source/Playnite/Common/TGASharpLib.cs:5517— TGA.SaveFunc has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GamesCollectionViewEntry.GetAdvancedGroupedEntry (cyclomatic 21) source/Playnite/GamesCollectionViewEntry.cs:273— GamesCollectionViewEntry.GetAdvancedGroupedEntry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GamesEditor.GetPlayActions (cyclomatic 21) source/Playnite/GamesEditor.cs:1682— GamesEditor.GetPlayActions has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StatisticsViewModel.FillData (cyclomatic 21) source/Playnite.DesktopApp/ViewModels/StatisticsViewModel.cs:325— StatisticsViewModel.FillData has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor (cyclomatic 21) source/Playnite.FullscreenApp/ViewModels/ExtensionsMenuViewModels.cs:222— ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatParser.ParseProperty (cyclomatic 21) source/Tools/Playnite.Utilities/DatParser.cs:129— DatParser.ParseProperty has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BsonReader.ReadElement (cyclomatic 20) source/Playnite/Database/Collections/LiteDBFileReaderV7.cs:80— BsonReader.ReadElement has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Game.GetScoreGroup (cyclomatic 20) source/PlayniteSDK/Models/Game.cs:1597— Game.GetScoreGroup has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GameMenu.InitializeItems (cyclomatic 20) source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:105— GameMenu.InitializeItems has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EmulatedGamesImportViewModel.StartScan (cyclomatic 20) source/Playnite.DesktopApp/ViewModels/EmulatedGamesImportViewModel.cs:331— EmulatedGamesImportViewModel.StartScan has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsViewModel.ConfirmDialog (cyclomatic 20) source/Playnite.DesktopApp/ViewModels/SettingsViewModel.cs:525— SettingsViewModel.ConfirmDialog has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FadeImage.LoadNewSource (cyclomatic 19) source/Playnite/Controls/FadeImage.xaml.cs:259— FadeImage.LoadNewSource has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SearchViewModel.TextBoxKeyUp (cyclomatic 19) source/Playnite/ViewModels/SearchViewModel.cs:883— SearchViewModel.TextBoxKeyUp has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GenericPlayController.StartEmulator (cyclomatic 18) source/Playnite/Controllers/GenericGameController.cs:72— GenericPlayController.StartEmulator has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Programs.GetUWPApps (cyclomatic 17) source/Playnite/Common/Programs2.cs:294— Programs.GetUWPApps has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SdkHelpers.ResolveUiItemIcon (cyclomatic 17) source/Playnite/SdkHelpers.cs:23— SdkHelpers.ResolveUiItemIcon has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameScannerConfig.CopyDiffTo (cyclomatic 17) source/PlayniteSDK/Models/GameScannerConfig.cs:249— GameScannerConfig.CopyDiffTo has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameAction.Equals (cyclomatic 17) source/PlayniteSDK/Models/GameAction.cs:324— GameAction.Equals has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MainMenu.AddExtensionItems (cyclomatic 17) source/Playnite.DesktopApp/Controls/Menus/MainMenu.cs:299— MainMenu.AddExtensionItems has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FullscreenTilePanel.MakeVisible (cyclomatic 17) source/Playnite.FullscreenApp/Controls/FullscreenTilePanel.cs:656— FullscreenTilePanel.MakeVisible has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor (cyclomatic 17) source/Playnite.FullscreenApp/ViewModels/ExtensionsMenuViewModels.cs:83— ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EmulatorScanner.SearchForEmulators (cyclomatic 16) source/Playnite/Emulators/Scanner.cs:59— EmulatorScanner.SearchForEmulators has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameScanner.LookupGameInDb (cyclomatic 16) source/Playnite/Emulators/Scanner.cs:1020— GameScanner.LookupGameInDb has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayniteApplication.CheckOtherInstances (cyclomatic 16) source/Playnite/App/PlayniteApplication.cs:925— PlayniteApplication.CheckOtherInstances has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 934, 972). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
StringExtensions.GetJaroWinklerSimilarity (cyclomatic 16) source/Playnite/Common/Extensions/StringExtensions.cs:467— StringExtensions.GetJaroWinklerSimilarity has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameDatabase.LoadUsedItems (cyclomatic 16) source/Playnite/Database/GameDatabase.cs:310— GameDatabase.LoadUsedItems has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameDatabase.GameInfoToGame (cyclomatic 16) source/Playnite/Database/GameDatabase.cs:1081— GameDatabase.GameInfoToGame has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DefaultSearchContext.GetSearchResults (cyclomatic 16) source/Playnite/ViewModels/SearchViewModel.cs:128— DefaultSearchContext.GetSearchResults has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FirstTimeStartupViewModel.NavigateNext (cyclomatic 16) source/Playnite.DesktopApp/ViewModels/FirstTimeStartupViewModel.cs:190— FirstTimeStartupViewModel.NavigateNext has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameEditViewModel.GetOrGenerateNewFieldItem (cyclomatic 16) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:406— GameEditViewModel.GetOrGenerateNewFieldItem has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GameEditViewModel.ConvertGameInfo (cyclomatic 16) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:481— GameEditViewModel.ConvertGameInfo has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DatParser.ProcessLibretroDb (cyclomatic 16) source/Tools/Playnite.Utilities/DatParser.cs:303— DatParser.ProcessLibretroDb has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 396). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D11 · Test Reliability· Test reliability not measured · ×1
Test reliability not measured — no test run produced results — Test reliability NOT MEASURED: the test run produced no results for any test tier, so no test ever ran and flakiness could not be exercised. The cause could not be attributed, so it is excluded from the score rather than read as an absence of tests.
D17 · Explicit Debt· BareSuppressMessage repeated 10 times in one file · ×1
BareSuppressMessage repeated 10 times in one file source/Playnite/Native/Windef.cs:110— The identical BareSuppressMessage (`SuppressMessage`) appears 10 times in one file — one decision applied repeatedly (e.g. the same rule silenced on every overload of a fluent API), not 10 independent debts. Decide it once — at the type or project level, or by fixing the underlying pattern — rather than occurrence-by-occurrence. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt· BarePragmaDisable repeated 12 times in one file · ×1
BarePragmaDisable repeated 12 times in one file source/Playnite/SDL2.cs:4998— The identical BarePragmaDisable (`#pragma warning disable 0169`) appears 12 times in one file — one decision applied repeatedly (e.g. the same rule silenced on every overload of a fluent API), not 12 independent debts. Decide it once — at the type or project level, or by fixing the underlying pattern — rather than occurrence-by-occurrence. (Every occurrence still counts toward the score and metrics.)
Monorepo: only 1 of 6 solutions was scored — This repository contains 6 .NET solutions, but a scan analyzes ONE. Every score, lens, and finding here reflects only `source/Playnite.sln` — the other 5 (`source/Tools/Playnite.Toolbox/Templates/Extensions/CustomLibraryPlugin/CustomLibraryPlugin.sln`, `source/Tools/Playnite.Toolbox/Templates/Extensions/CustomMetadataPlugin/CustomMetadataPlugin.sln`, `source/Tools/Playnite.Toolbox/Templates/Extensions/GenericPlugin/GenericPlugin.sln`, `source/Tools/Playnite.Toolbox/Templates/Themes/Desktop/Theme.sln`, `source/Tools/Playnite.Toolbox/Templates/Themes/Fullscreen/Theme.sln`) were not analyzed and are not represented in the headline. To cover them, scan each solution as its own target and group them in a Solution or Product for a portfolio roll-up. If a secondary solution is an archived or vendored tree, declare it — `.gitattributes` (`path/** linguist-vendored`) or `.editorconfig` (`[path/**] generated_code = true`) — to exclude it from discovery the same way generated code is.
MetadataDownloader.DownloadMetadataAsync (cognitive 233) source/Playnite/Metadata/MetadataDownloader.cs:311— MetadataDownloader.DownloadMetadataAsync has cognitive complexity 233 (threshold 15). Most of this is not in the body itself: 0 of the 233 points are its own statements and the rest belongs to one function literal inside it that branches (line 318). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
GameDatabase.MigrateNewDatabaseFormat (cognitive 190) source/Playnite/Database/GameDatabaseMigration.cs:22— GameDatabase.MigrateNewDatabaseFormat has cognitive complexity 190 (threshold 15). Of this number, 115 points are the body's own statements and 75 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GameEditViewModel.ConfirmDialog (cognitive 145) source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:525— GameEditViewModel.ConfirmDialog has cognitive complexity 145 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameEditViewModel.EditingGame_PropertyChanged (cognitive 130) source/Playnite.DesktopApp/ViewModels/GameEditViewModelFieldChecks.cs:849— GameEditViewModel.EditingGame_PropertyChanged has cognitive complexity 130 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlayniteApplication.PlayniteApplication.ctor (cognitive 118) source/Playnite/App/PlayniteApplication.cs:92— PlayniteApplication.PlayniteApplication.ctor has cognitive complexity 118 (threshold 15). Of this number, 116 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Game.CopyDiffTo (cognitive 108) source/PlayniteSDK/Models/Game.cs:1750— Game.CopyDiffTo has cognitive complexity 108 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TGA.CheckAndUpdateOffsets (cognitive 104) source/Playnite/Common/TGASharpLib.cs:4799— TGA.CheckAndUpdateOffsets has cognitive complexity 104 (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.
GameScanner.ScanDirectoryBase (cognitive 99) source/Playnite/Emulators/Scanner.cs:693— GameScanner.ScanDirectoryBase has cognitive complexity 99 (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.
GameScanner.Scan (cognitive 91) source/Playnite/Emulators/Scanner.cs:185— GameScanner.Scan has cognitive complexity 91 (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.
GameDatabase.ImportGames (cognitive 85) source/Playnite/Database/GameDatabase.cs:1205— GameDatabase.ImportGames has cognitive complexity 85 (threshold 15). Of this number, 84 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Game.GetDifferences (cognitive 75) source/PlayniteSDK/Models/Game.cs:2032— Game.GetDifferences has cognitive complexity 75 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GenericPlayController.Start (cognitive 74) source/Playnite/Controllers/GenericGameController.cs:481— GenericPlayController.Start has cognitive complexity 74 (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.
GamesEditor.GetPlayActions (cognitive 73) source/Playnite/GamesEditor.cs:1682— GamesEditor.GetPlayActions has cognitive complexity 73 (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.
TGA.LoadFunc (cognitive 70) source/Playnite/Common/TGASharpLib.cs:5298— TGA.LoadFunc has cognitive complexity 70 (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.
GameEditViewModel.GetDisplayDiffFields (cognitive 63) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:56— GameEditViewModel.GetDisplayDiffFields has cognitive complexity 63 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TGA.ToBitmapFunc (cognitive 61) source/Playnite/Common/TGASharpLib.cs:5681— TGA.ToBitmapFunc has cognitive complexity 61 (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.
ItemsControlEx.ItemsControlEx_PreviewKeyDown (cognitive 60) source/Playnite.FullscreenApp/Controls/ItemsControlEx.cs:38— ItemsControlEx.ItemsControlEx_PreviewKeyDown has cognitive complexity 60 (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.
EmulatorScanner.SearchForEmulators (cognitive 57) source/Playnite/Emulators/Scanner.cs:59— EmulatorScanner.SearchForEmulators has cognitive complexity 57 (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.
TGA.LoadFunc (cognitive 54) source/Playnite/Common/TGASharpLib.cs:5138— TGA.LoadFunc 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.
Main.OnApplyTemplate (cognitive 49) source/Playnite.FullscreenApp/Controls/Views/Main.cs:226— Main.OnApplyTemplate has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GamesEditor.Controllers_Stopped (cognitive 48) source/Playnite/GamesEditor.cs:1416— GamesEditor.Controllers_Stopped has cognitive complexity 48 (threshold 15). Of this number, 28 points are the body's own statements and 20 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
Backup.RestoreBackup (cognitive 47) source/Playnite/Backup.cs:212— Backup.RestoreBackup has cognitive complexity 47 (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.
MenuItems.GetSearchGameMenuItems (cognitive 47) source/Playnite/MenuItems.cs:164— MenuItems.GetSearchGameMenuItems has cognitive complexity 47 (threshold 15). Of this number, 44 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GameScanner.LookupGameInDb (cognitive 46) source/Playnite/Emulators/Scanner.cs:1020— GameScanner.LookupGameInDb has cognitive complexity 46 (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.
CloneObject.CopyProperties (cognitive 46) source/Playnite/Common/Extensions/CloneObject.cs:113— CloneObject.CopyProperties has cognitive complexity 46 (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.
DesktopAppViewModel.OnFileDropped (cognitive 45) source/Playnite.DesktopApp/ViewModels/DesktopAppViewModel.cs:836— DesktopAppViewModel.OnFileDropped has cognitive complexity 45 (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.
Backup.BackupData (cognitive 44) source/Playnite/Backup.cs:73— Backup.BackupData has cognitive complexity 44 (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.
GamesEditor.PlayGame (cognitive 44) source/Playnite/GamesEditor.cs:189— GamesEditor.PlayGame has cognitive complexity 44 (threshold 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MetadataDownloader.ProcessField (cognitive 44) source/Playnite/Metadata/MetadataDownloader.cs:136— MetadataDownloader.ProcessField has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericPlayController.StartEmulator (cognitive 44) source/Playnite/Controllers/GenericGameController.cs:72— GenericPlayController.StartEmulator has cognitive complexity 44 (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.
MainMenu.AddExtensionItems (cognitive 44) source/Playnite.DesktopApp/Controls/Menus/MainMenu.cs:299— MainMenu.AddExtensionItems has cognitive complexity 44 (threshold 15). Of this number, 39 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor (cognitive 44) source/Playnite.FullscreenApp/ViewModels/ExtensionsMenuViewModels.cs:222— ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor has cognitive complexity 44 (threshold 15). Of this number, 40 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseExplorer.LoadValues (cognitive 43) source/Playnite/Database/DatabaseExplorer.cs:723— DatabaseExplorer.LoadValues has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameEditViewModel.GetOrGenerateNewFieldItem (cognitive 43) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:406— GameEditViewModel.GetOrGenerateNewFieldItem has cognitive complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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.
GamesEditor.CalculateGameSize (cognitive 42) source/Playnite/GamesEditor.cs:566— GamesEditor.CalculateGameSize has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TGA.SaveFunc (cognitive 40) source/Playnite/Common/TGASharpLib.cs:5517— TGA.SaveFunc has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageSourceManager.GetImage (cognitive 40) source/Playnite/ImageSourceManager.cs:160— ImageSourceManager.GetImage has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteApplication.Application_Startup (cognitive 39) source/Playnite/App/PlayniteApplication.cs:599— PlayniteApplication.Application_Startup has cognitive complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Themes.UpdateTheme (cognitive 39) source/Tools/Playnite.Toolbox/Themes.cs:272— Themes.UpdateTheme has cognitive complexity 39 (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.
GameMenu.AddExtensionItems (cognitive 38) source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:580— GameMenu.AddExtensionItems has cognitive complexity 38 (threshold 15). Of this number, 33 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, 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.
BitmapExtensions.BitmapFromStream (cognitive 37) source/Playnite/Common/Extensions/BitmapExtensions.cs:249— BitmapExtensions.BitmapFromStream has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseFilter.UpdateAllCollections (cognitive 37) source/Playnite/Database/DatabaseFilter.cs:375— DatabaseFilter.UpdateAllCollections has cognitive complexity 37 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FadeImage.LoadNewSource (cognitive 36) source/Playnite/Controls/FadeImage.xaml.cs:259— FadeImage.LoadNewSource has cognitive complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SdkHelpers.ResolveUiItemIcon (cognitive 36) source/Playnite/SdkHelpers.cs:23— SdkHelpers.ResolveUiItemIcon has cognitive complexity 36 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EmulatedGamesImportViewModel.StartScan (cognitive 36) source/Playnite.DesktopApp/ViewModels/EmulatedGamesImportViewModel.cs:331— EmulatedGamesImportViewModel.StartScan has cognitive complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor (cognitive 36) source/Playnite.FullscreenApp/ViewModels/ExtensionsMenuViewModels.cs:83— ExtensionsMenuViewModels.ExtensionsMenuViewModels.ctor has cognitive complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteSettings.LoadSettings (cognitive 35) source/Playnite/Settings/PlayniteSettings.cs:2352— PlayniteSettings.LoadSettings 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.
FullscreenAppViewModel.Fullscreen_PropertyChanged (cognitive 35) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel.cs:579— FullscreenAppViewModel.Fullscreen_PropertyChanged has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CategoryConfigViewModel.SetCategoryStates (cognitive 34) source/Playnite.DesktopApp/ViewModels/CategoryConfigViewModel.cs:205— CategoryConfigViewModel.SetCategoryStates 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.
StatisticsViewModel.FillData (cognitive 33) source/Playnite.DesktopApp/ViewModels/StatisticsViewModel.cs:325— StatisticsViewModel.FillData has cognitive complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullscreenAppViewModel.InitializeCommands (cognitive 33) source/Playnite.FullscreenApp/ViewModels/FullscreenAppViewModel_Commands.cs:45— FullscreenAppViewModel.InitializeCommands has cognitive complexity 33 (threshold 15). Most of this is not in the body itself: 0 of the 33 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 56, 205, 266, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Programs.GetUWPApps (cognitive 32) source/Playnite/Common/Programs2.cs:294— Programs.GetUWPApps has cognitive complexity 32 (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.
ThemeManager.GetAvailableThemes (cognitive 32) source/Playnite/Themes.cs:235— ThemeManager.GetAvailableThemes has cognitive complexity 32 (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.
GameScannerConfig.CopyDiffTo (cognitive 32) source/PlayniteSDK/Models/GameScannerConfig.cs:249— GameScannerConfig.CopyDiffTo has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileReaderV7.GetDocuments (cognitive 31) source/Playnite/Database/Collections/LiteDBFileReaderV7.cs:653— FileReaderV7.GetDocuments 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.
PlayniteApplication.PipeService_CommandExecuted (cognitive 31) source/Playnite/App/PlayniteApplication.cs:780— PlayniteApplication.PipeService_CommandExecuted has cognitive complexity 31 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GameDatabase.AddFile (cognitive 31) source/Playnite/Database/GameDatabase.cs:833— GameDatabase.AddFile 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.
ThemeFile.GetFilePath (cognitive 31) source/Playnite/Extensions/Markup/ThemeFile.cs:107— ThemeFile.GetFilePath has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterSettings.ClearFilters (cognitive 31) source/Playnite/Settings/FilterSettings.cs:956— FilterSettings.ClearFilters has cognitive complexity 31 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FirstTimeStartupViewModel.NavigateNext (cognitive 31) source/Playnite.DesktopApp/ViewModels/FirstTimeStartupViewModel.cs:190— FirstTimeStartupViewModel.NavigateNext has cognitive complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControlTemplateTools.InitializePluginControls (cognitive 30) source/Playnite/ControlTemplateTools.cs:19— ControlTemplateTools.InitializePluginControls 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.
ScannedGame.ToGame (cognitive 30) source/Playnite/Emulators/Scanner.cs:1333— ScannedGame.ToGame 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.
GameExtensions.GetGameFromExecutable (cognitive 30) source/Playnite/Extensions/GameExtensions.cs:58— GameExtensions.GetGameFromExecutable 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.
GamesCollectionViewEntry.GetAdvancedGroupedEntry (cognitive 30) source/Playnite/GamesCollectionViewEntry.cs:273— GamesCollectionViewEntry.GetAdvancedGroupedEntry has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtensionFactory.LoadPlugins (cognitive 30) source/Playnite/Plugins/ExtensionFactory.cs:390— ExtensionFactory.LoadPlugins has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterSettings.ApplyFilter (cognitive 30) source/Playnite/Settings/FilterSettings.cs:1221— FilterSettings.ApplyFilter has cognitive complexity 30 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ThemeManager.ApplyTheme (cognitive 30) source/Playnite/Themes.cs:92— ThemeManager.ApplyTheme has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GamesGridView.GetColumn (cognitive 30) source/Playnite.DesktopApp/Controls/GamesGridView.xaml.cs:208— GamesGridView.GetColumn has cognitive complexity 30 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExtensionFactory.GetInstalledManifests (cognitive 29) source/Playnite/Plugins/ExtensionFactory.cs:231— ExtensionFactory.GetInstalledManifests 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.
GameTools.GetMultiGameEditObject (cognitive 29) source/Playnite/GameTools.cs:28— GameTools.GetMultiGameEditObject has cognitive complexity 29 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesktopCollectionView.Database_GamesCollectionChanged (cognitive 29) source/Playnite.DesktopApp/DesktopCollectionView.cs:568— DesktopCollectionView.Database_GamesCollectionChanged 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.
CategoryConfigViewModel.SetCategories (cognitive 29) source/Playnite.DesktopApp/ViewModels/CategoryConfigViewModel.cs:142— CategoryConfigViewModel.SetCategories has cognitive complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DatParser.ParseProperty (cognitive 29) source/Tools/Playnite.Utilities/DatParser.cs:129— DatParser.ParseProperty has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterMatcher.Match (cognitive 28) source/Playnite/Database/GameDatabase_Filters.cs:60— FilterMatcher.Match has cognitive complexity 28 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MenuItems.GetSearchExtensionsMainMenuItem (cognitive 28) source/Playnite/MenuItems.cs:83— MenuItems.GetSearchExtensionsMainMenuItem 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.
GenericPlayController.StartTracking (cognitive 28) source/Playnite/Controllers/GenericGameController.cs:670— GenericPlayController.StartTracking has cognitive complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 684). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
GameEditViewModel.LoadNewMetadata (cognitive 28) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:252— GameEditViewModel.LoadNewMetadata has cognitive complexity 28 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MetadataComparisonViewModel.ConfirmDialog (cognitive 28) source/Playnite.DesktopApp/ViewModels/MetadataComparisonViewModel.cs:264— MetadataComparisonViewModel.ConfirmDialog has cognitive complexity 28 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GameDatabase.LoadUsedItems (cognitive 27) source/Playnite/Database/GameDatabase.cs:310— GameDatabase.LoadUsedItems has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameMenu.InitializeItems (cognitive 27) source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:105— GameMenu.InitializeItems has cognitive complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GameEditViewModel.Init (cognitive 27) source/Playnite.DesktopApp/ViewModels/GameEditViewModel.cs:319— GameEditViewModel.Init has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteApplication.CheckOtherInstances (cognitive 26) source/Playnite/App/PlayniteApplication.cs:925— PlayniteApplication.CheckOtherInstances has cognitive complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 934, 972). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
GenericPlayController.StartEmulatorProcess (cognitive 26) source/Playnite/Controllers/GenericGameController.cs:221— GenericPlayController.StartEmulatorProcess has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GridViewPanel.MeasureOverride (cognitive 26) source/Playnite.DesktopApp/Controls/GridViewPanel.cs:111— GridViewPanel.MeasureOverride has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TGA.RLE_Encode (cognitive 25) source/Playnite/Common/TGASharpLib.cs:5609— TGA.RLE_Encode 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.
ExtensionInstaller.InstallExtensionQueue (cognitive 25) source/Playnite/Plugins/ExtensionInstaller.cs:118— ExtensionInstaller.InstallExtensionQueue has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameTaskView.ComboEmulatorConfig_SelectionChanged (cognitive 25) source/Playnite.DesktopApp/Controls/GameTaskView.xaml.cs:388— GameTaskView.ComboEmulatorConfig_SelectionChanged 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.
SettingsViewModel.ConfirmDialog (cognitive 25) source/Playnite.DesktopApp/ViewModels/SettingsViewModel.cs:525— SettingsViewModel.ConfirmDialog has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortableNameConverter.ConvertRomanNumeralToInt (cognitive 24) source/Playnite/SortableNameConverter.cs:139— SortableNameConverter.ConvertRomanNumeralToInt has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileReaderV7.ReadPage (cognitive 24) source/Playnite/Database/Collections/LiteDBFileReaderV7.cs:714— FileReaderV7.ReadPage has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameScanner.ScanDirectory (cognitive 24) source/Playnite/Emulators/Scanner.cs:521— GameScanner.ScanDirectory has cognitive complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
StringExtensions.GetJaroWinklerSimilarity (cognitive 24) source/Playnite/Common/Extensions/StringExtensions.cs:467— StringExtensions.GetJaroWinklerSimilarity has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainViewModelBase.AddFilterPreset (cognitive 24) source/Playnite/ViewModels/MainViewModelBase.cs:412— MainViewModelBase.AddFilterPreset has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchViewModel.TextBoxKeyDown (cognitive 24) source/Playnite/ViewModels/SearchViewModel.cs:814— SearchViewModel.TextBoxKeyDown has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchViewModel.PerformSearch (cognitive 23) source/Playnite/ViewModels/SearchViewModel.cs:717— SearchViewModel.PerformSearch has cognitive complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 736). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
BsonReader.ReadElement (cognitive 22) source/Playnite/Database/Collections/LiteDBFileReaderV7.cs:80— BsonReader.ReadElement has cognitive complexity 22 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SortableNameConverter.Convert (cognitive 21) source/Playnite/SortableNameConverter.cs:66— SortableNameConverter.Convert has cognitive complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 75). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
GenericTypeConverter.Convert (cognitive 21) source/Playnite/Converters/GenericTypeConverter.cs:22— GenericTypeConverter.Convert has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowBase.OnApplyTemplate (cognitive 21) source/Playnite/Controls/WindowBase.cs:299— WindowBase.OnApplyTemplate has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtensionFactory.LoadPlugins (cognitive 21) source/Playnite/Plugins/ExtensionFactory.cs:461— ExtensionFactory.LoadPlugins 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.
ThemeManager.ApplyFullscreenButtonPrompts (cognitive 21) source/Playnite/Themes.cs:53— ThemeManager.ApplyFullscreenButtonPrompts 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.
EmulatorsViewModel.CheckUnsavedChanges (cognitive 21) source/Playnite.DesktopApp/ViewModels/EmulatorsViewModel.cs:368— EmulatorsViewModel.CheckUnsavedChanges has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteApplication.CurrentDomain_UnhandledException (cognitive 20) source/Playnite/App/PlayniteApplication.cs:496— PlayniteApplication.CurrentDomain_UnhandledException has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultSearchContext.GetSearchResults (cognitive 20) source/Playnite/ViewModels/SearchViewModel.cs:128— DefaultSearchContext.GetSearchResults has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DatabaseFieldsManagerViewModel.UpdatePlatformsCollection (cognitive 20) source/Playnite.DesktopApp/ViewModels/DatabaseFieldsManagerViewModel.cs:740— DatabaseFieldsManagerViewModel.UpdatePlatformsCollection has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteApplication.CheckForUpdates (cognitive 19) source/Playnite/App/PlayniteApplication.cs:1342— PlayniteApplication.CheckForUpdates has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FocusBahaviors.FocusBindingPropertyChanged (cognitive 19) source/Playnite/Behaviors/FocusBahaviors.cs:36— FocusBahaviors.FocusBindingPropertyChanged has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TGA.GetInfo (cognitive 19) source/Playnite/Common/TGASharpLib.cs:4703— TGA.GetInfo has cognitive complexity 19 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Xml.AreEqual (cognitive 19) source/Playnite/Common/Xml.cs:14— Xml.AreEqual has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GameDatabase.OpenDatabase (cognitive 19) source/Playnite/Database/GameDatabase.cs:502— GameDatabase.OpenDatabase has cognitive complexity 19 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GamesEditor.RemoveGames (cognitive 19) source/Playnite/GamesEditor.cs:938— GamesEditor.RemoveGames has cognitive complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game.GetScoreGroup (cognitive 19) source/PlayniteSDK/Models/Game.cs:1597— Game.GetScoreGroup has cognitive complexity 19 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GameScanner.ParseExclusions (cognitive 18) source/Playnite/Emulators/Scanner.cs:401— GameScanner.ParseExclusions has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayniteApplication.ProcessUriRequest (cognitive 18) source/Playnite/App/PlayniteApplication.cs:1118— PlayniteApplication.ProcessUriRequest has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringExtensions.IsStartOfStringAcronym (cognitive 18) source/Playnite/Common/Extensions/StringExtensions.cs:105— StringExtensions.IsStartOfStringAcronym 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.
BindingExtension.ProvideValue (cognitive 18) source/Playnite/Extensions/Markup/BindingExtension.cs:36— BindingExtension.ProvideValue has cognitive complexity 18 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
User32.EnablePrivilege (cognitive 18) source/Playnite/Native/User32.cs:171— User32.EnablePrivilege 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.
MainViewModelBase.UpdateLibraryData (cognitive 18) source/Playnite/ViewModels/MainViewModelBase.cs:741— MainViewModelBase.UpdateLibraryData has cognitive complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 754). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
SearchViewModel.TextBoxKeyUp (cognitive 18) source/Playnite/ViewModels/SearchViewModel.cs:883— SearchViewModel.TextBoxKeyUp has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GameMenu.InitializeItems (cognitive 18) source/Playnite.DesktopApp/Controls/Menus/GameMenu.cs:461— GameMenu.InitializeItems has cognitive complexity 18 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GameEditViewModel.ConvertGameInfo (cognitive 18) source/Playnite.DesktopApp/ViewModels/GameEditViewModelMetadata.cs:481— GameEditViewModel.ConvertGameInfo has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ToolsConfigViewModel.AddAppFromExe (cognitive 18) source/Playnite.DesktopApp/ViewModels/ToolsConfigViewModel.cs:182— ToolsConfigViewModel.AddAppFromExe 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.
FullscreenApplication.FullscreenApplication_PropertyChanged (cognitive 18) source/Playnite.FullscreenApp/FullscreenApplication.cs:138— FullscreenApplication.FullscreenApplication_PropertyChanged 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.
Themes.PackageTheme (cognitive 18) source/Tools/Playnite.Toolbox/Themes.cs:171— Themes.PackageTheme has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuHelpers.GenerateMenuParents (cognitive 17) source/Playnite/MenuHelpers.cs:75— MenuHelpers.GenerateMenuParents 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.
GameExtensions.GetRawExecutablePath (cognitive 17) source/Playnite/Extensions/GameExtensions.cs:283— GameExtensions.GetRawExecutablePath has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GamesEditor.RemoveGame (cognitive 17) source/Playnite/GamesEditor.cs:873— GamesEditor.RemoveGame has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtensionFactory.LoadScripts (cognitive 17) source/Playnite/Plugins/ExtensionFactory.cs:322— ExtensionFactory.LoadScripts has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Diagnostic.CreateDiagPackage (cognitive 17) source/Playnite/Diagnostic.cs:60— Diagnostic.CreateDiagPackage 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.
GameControllerManager.ShouldResendKey (cognitive 17) source/Playnite/Input/GameController.cs:359— GameControllerManager.ShouldResendKey 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.
DatabaseFieldsManagerViewModel.RemoveUnusedPlatforms (cognitive 17) source/Playnite.DesktopApp/ViewModels/DatabaseFieldsManagerViewModel.cs:870— DatabaseFieldsManagerViewModel.RemoveUnusedPlatforms has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
EmulatedGamesImportViewModel.ExcludeDirectories (cognitive 17) source/Playnite.DesktopApp/ViewModels/EmulatedGamesImportViewModel.cs:577— EmulatedGamesImportViewModel.ExcludeDirectories 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.
FullscreenTilePanel.MeasureOverride (cognitive 17) source/Playnite.FullscreenApp/Controls/FullscreenTilePanel.cs:239— FullscreenTilePanel.MeasureOverride has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullscreenTilePanel.MakeVisible (cognitive 17) source/Playnite.FullscreenApp/Controls/FullscreenTilePanel.cs:656— FullscreenTilePanel.MakeVisible has cognitive complexity 17 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Addons.CheckAddonsForUpdate (cognitive 16) source/Playnite/Addons/Addons.cs:63— Addons.CheckAddonsForUpdate has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
StringExtensions.GetLevenshteinDistance (cognitive 16) source/Playnite/Common/Extensions/StringExtensions.cs:394— StringExtensions.GetLevenshteinDistance 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.
ExtensionFactory.GetManifestsFromPath (cognitive 16) source/Playnite/Plugins/ExtensionFactory.cs:173— ExtensionFactory.GetManifestsFromPath has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RandomGameSelectViewModel.PickGame (cognitive 16) source/Playnite/ViewModels/RandomGameSelectViewModel.cs:121— RandomGameSelectViewModel.PickGame has cognitive complexity 16 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GameControllerManager.ProcessButtonState (cognitive 16) source/Playnite/Input/GameController.cs:408— GameControllerManager.ProcessButtonState has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each i...
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.