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

Frodo45127/rpfm

Measured 17 November 2026, 19:10 UTC, at code version 576f397

First survey, so nothing to compare with yet
CAI score 52.2out of 100 At risk

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

A large codebase: 163,685 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Security and Compliance, 45.6

Findings by how serious they are

39 critical 1548 serious 109 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 19:10 UTC

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

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

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

57of 57 dimensions measured by tools.
1653of 1696 findings point to an exact file and line, so you can open each one in the code. The other 43 concern the repository as a whole, such as missing documentation.
57dimensions across 8 lenses, read from 163,685 lines of product code in 8 projects.
Chapters

Executive summary

Frodo45127/rpfm is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back in part because two of the dependencies have a known vulnerability. It scores 52.2 out of 100, which the At risk rating leaves unchanged.

Security and Compliance, at 45.6, is the weakest lens and counts most in the score. The best first step is serving traffic only over an encrypted connection, worth about 5.1 points. Fixing the package with a known security hole would lift Security and Compliance itself, worth about 1.5 points. Raising Security and Compliance to 70 would lift the score to about 57.0.

Fourteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Four secrets can leak from the build pipeline, and eight sets of files in separate parts keep changing together, which points to hidden dependencies. Pinning each tool to an exact version, limiting each secret to its own step and making the hidden dependencies explicit would close these risks. Updating the vulnerable packages would fix the three packages with a known security hole, and the two passwords or keys in the code's history need replacing, with the old ones switched off. The package under a licence on your banned list needs replacing, or clearing with your legal team.

The product code is 163,685 lines, about €170,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Security and Compliance 45.6 · counts for 45%Production Readiness 48.9 · counts for 25%Code Health 54.4 · counts for 14%Maturity 67.7 · counts for 8%Event-Driven 74.1 · counts for 4%Accessibility 78.6 · counts for 2%Architecture 88.5 · counts for 1%Performance 100.0 · counts for 1%

If Security and Compliance rose from 45.6 to 70, the lowest score rated Strong, the score would rise from 52.2 to about 57.0.

Code composition: what the lines of code are
Product code 94%Tests 6%
Rebuild cost: about €170,000 · Estimate
Cost to rebuild€56,000 to €280,000, for 927 to 2,942 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 52. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 163,685 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Raises the score by about 5.1 points · Medium effort · Web-Security Posture
2
Resolve the 1 Banned license finding(s) in License Compliance.
Raises the score by about 2.0 points · Low effort · License Compliance
3
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4).
Raises the score by about 1.8 points · Low effort · Static Analysis (SAST)

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €170,000 to build again, about 1.2 person-years of work. Its weakest lens is Security and Compliance, at 45.6 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only. Of all the actions in this report, it raises the score most for the work it takes: about 5.1 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 94,701 lines over the last 90 days, which is about 384,065 lines a year. At that pace, the extra work comes to an estimated 61.7 to 370.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch rpfm_extensions rpfm_extensions rpfm_lib rpfm_lib rpfm_extensions->rpfm_lib rpfm_ipc rpfm_ipc rpfm_ipc->rpfm_extensions rpfm_ipc->rpfm_lib rpfm_server rpfm_server rpfm_server->rpfm_extensions rpfm_server->rpfm_ipc rpfm_server->rpfm_lib rpfm_telemetry rpfm_telemetry rpfm_server->rpfm_telemetry rpfm_ui rpfm_ui rpfm_ui->rpfm_extensions rpfm_ui->rpfm_ipc rpfm_ui->rpfm_lib rpfm_ui->rpfm_telemetry rpfm_ui_common rpfm_ui_common rpfm_ui->rpfm_ui_common rpfm_ui_common->rpfm_lib

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

456 modules, with 1229 dependencies between them. 13 loops run through 50 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 rpfm_ipc.api2 rpfm_lib.error3 rpfm_lib.games4 rpfm_lib.files.table5 rpfm_lib.schema6 rpfm_lib.files7 rpfm_extensions.optimizer8 rpfm_lib.files.bmd9 rpfm_lib.files.bmd.common10 rpfm_lib.files.esf11 rpfm_lib.files.pack12 rpfm_ui.packfile_contents_ui13 rpfm_extensions.dependencies14 rpfm_extensions.startpos.layout15 rpfm_lib.files.db16 rpfm_ui.dependencies_ui17 rpfm_extensions.diagnostics18 rpfm_extensions.search19 rpfm_extensions.startpos.cai.world_view20 rpfm_extensions.startpos.tables21 rpfm_ipc.helpers22 rpfm_ui.references_ui23 rpfm_extensions.startpos.extract24 rpfm_extensions.startpos.generator25 rpfm_extensions.startpos.world26 rpfm_ipc.api.files27 rpfm_ui.packedfile_views28 rpfm_extensions.startpos.cai.world29 rpfm_extensions.startpos.world.writer30 rpfm_server.state31 rpfm_ui.global_search_ui32 rpfm_extensions.startpos.world.writer.characters33 rpfm_ui.diagnostics_ui34 rpfm_ui.app_ui35 rpfm_ui.packedfile_views.esf36 rpfm_ui.packedfile_views.group_formations37 rpfm_ui.views.table38 rpfm_ui.packedfile_views.rigidmodel39 rpfm_ui.tools.translator40 rpfm_ui.views.table.utils
1 rpfm_ipc.api
2 rpfm_lib.error
3 rpfm_lib.games
4 rpfm_lib.files.table4
5 rpfm_lib.schema1
6 rpfm_lib.files34
7 rpfm_extensions.optimizer1122
8 rpfm_lib.files.bmd4
9 rpfm_lib.files.bmd.common48
10 rpfm_lib.files.esf4
11 rpfm_lib.files.pack117
12 rpfm_ui.packfile_contents_ui11
13 rpfm_extensions.dependencies1221
14 rpfm_extensions.startpos.layout212
15 rpfm_lib.files.db1351
16 rpfm_ui.dependencies_ui11
17 rpfm_extensions.diagnostics1111
18 rpfm_extensions.search1231
19 rpfm_extensions.startpos.cai.world_view124
20 rpfm_extensions.startpos.tables121
21 rpfm_ipc.helpers22111
22 rpfm_ui.references_ui11111
23 rpfm_extensions.startpos.extract11251
24 rpfm_extensions.startpos.generator11213323
25 rpfm_extensions.startpos.world3
26 rpfm_ipc.api.files2152
27 rpfm_ui.packedfile_views1111
28 rpfm_extensions.startpos.cai.world22111
29 rpfm_extensions.startpos.world.writer226
30 rpfm_server.state234122111416
31 rpfm_ui.global_search_ui11131111
32 rpfm_extensions.startpos.world.writer.characters1163
33 rpfm_ui.diagnostics_ui11112111
34 rpfm_ui.app_ui21111211
35 rpfm_ui.packedfile_views.esf11111111
36 rpfm_ui.packedfile_views.group_formations11211
37 rpfm_ui.views.table111111111
38 rpfm_ui.packedfile_views.rigidmodel111111111
39 rpfm_ui.tools.translator1111111
40 rpfm_ui.views.table.utils12111111112
Uses a module listed above itPart of a loopThe module itself
1 rpfm_ipc.api2 rpfm_lib.error3 rpfm_lib.games4 rpfm_lib.files.table5 rpfm_lib.schema6 rpfm_lib.files7 rpfm_extensions.optimizer8 rpfm_lib.files.bmd9 rpfm_lib.files.bmd.common10 rpfm_lib.files.esf11 rpfm_lib.files.pack12 rpfm_ui.packfile_contents_ui13 rpfm_extensions.dependencies14 rpfm_extensions.startpos.layout15 rpfm_lib.files.db16 rpfm_ui.dependencies_ui17 rpfm_extensions.diagnostics18 rpfm_extensions.search19 rpfm_extensions.startpos.cai.world_view20 rpfm_extensions.startpos.tables21 rpfm_ipc.helpers22 rpfm_ui.references_ui23 rpfm_extensions.startpos.extract24 rpfm_extensions.startpos.generator25 rpfm_extensions.startpos.world26 rpfm_ipc.api.files27 rpfm_ui.packedfile_views28 rpfm_extensions.startpos.cai.world29 rpfm_extensions.startpos.world.writer30 rpfm_server.state31 rpfm_ui.global_search_ui32 rpfm_extensions.startpos.world.writer.characters33 rpfm_ui.diagnostics_ui34 rpfm_ui.app_ui35 rpfm_ui.packedfile_views.esf36 rpfm_ui.packedfile_views.group_formations37 rpfm_ui.views.table38 rpfm_ui.packedfile_views.rigidmodel39 rpfm_ui.tools.translator40 rpfm_ui.views.table.utilsrpfm_ipc.api1rpfm_lib.error2rpfm_lib.games3rpfm_lib.files.table4rpfm_lib.schema5rpfm_lib.files6rpfm_extensions.optimizer7rpfm_lib.files.bmd8rpfm_lib.files.bmd.common9rpfm_lib.files.esf10rpfm_lib.files.pack11rpfm_ui.packfile_contents_ui12rpfm_extensions.dependencies13rpfm_extensions.startpos.layout14rpfm_lib.files.db15rpfm_ui.dependencies_ui16rpfm_extensions.diagnostics17rpfm_extensions.search18rpfm_extensions.startpos.cai.world_view19rpfm_extensions.startpos.tables20rpfm_ipc.helpers21rpfm_ui.references_ui22rpfm_extensions.startpos.extract23rpfm_extensions.startpos.generator24rpfm_extensions.startpos.world25rpfm_ipc.api.files26rpfm_ui.packedfile_views27rpfm_extensions.startpos.cai.world28rpfm_extensions.startpos.world.writer29rpfm_server.state30rpfm_ui.global_search_ui31rpfm_extensions.startpos.world.writer.characters32rpfm_ui.diagnostics_ui33rpfm_ui.app_ui34rpfm_ui.packedfile_views.esf35rpfm_ui.packedfile_views.group_formations36rpfm_ui.views.table37rpfm_ui.packedfile_views.rigidmodel38rpfm_ui.tools.translator39rpfm_ui.views.table.utils4041341122448411711122121213511111111231124121221111111111251112133233215211112211122623412211141611131111116311112111211112111111111111211111111111111111111111111112111111112+416 more modules (most-connected shown)

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

At a glance — Architecture · 88.5 · Adequate · gated by D26 ·

At a glance — Maturity · 67.7 · Adequate · gated by M2 ·

At a glance — Readiness · 48.9 · Weak · gated by P3, P7 ·

At a glance — Security · 45.6 · Weak · gated by D29, D36 ·

At a glance — Event-Driven · 74.1 · Strong ·

At a glance — Accessibility · 78.6 · Strong ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures49High / Critical
A05:2025 — Injection24High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only; Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Bring the 332 bodies over 15 down to 15 or less in Cognitive Complexity — start with PackFileContentsSlots::new (cognitive 559), rpfm_server::ceo_builder::build_ceo_entries (cognitive 489), AppUI::open_packedfile (cognitive 337).

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

Do thisHelpsEffortDimension
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+5.1 ptsMediumWeb-Security Posture
Resolve the 1 Banned license finding(s) in License Compliance.+2.0 ptsLowLicense Compliance
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4).+1.8 ptsLowStatic Analysis (SAST)
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.2 ptsMediumSecurity & performance tooling
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED (2).+1.5 ptsLowSecrets (history)
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.5 ptsLowStatic Analysis (SAST)
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+1.5 ptsLowDependency Vulnerabilities
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2).+1.5 ptsLowDependency Vulnerabilities

File quality

Per-file score 0–10 — a quality signature. Of 248 files carrying findings, judged against the Production bar: 2% slop · 65% mixed · 33% near-clean.

FileScoreBandWorst signal
REDACTED0.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
rpfm_ui/src/app_ui/slots.rs5.5MixedCyclomatic Complexity: AppUISlots::new (cyclomatic 146)
rpfm_lib/src/schema/mod.rs5.5MixedCyclomatic Complexity: Definition::update_from_raw_definition (cyclomatic 29)
rpfm_ui/src/tools/unit_editor/mod.rs5.5MixedCognitive Complexity: ToolUnitEditor::new (cognitive 25)
rpfm_lib/src/files/anim_fragment_battle/mod.rs5.9MixedCyclomatic Complexity: AnimFragmentBattle::from_table (cyclomatic 31)
rpfm_lib/src/binary/reader.rs5.9MixedCode Duplication: Edited copy of a member (48 corresponding lines)
rpfm_ui/src/packfile_contents_ui/slots.rs6.0MixedExplicit Debt: TodoComment
rpfm_extensions/src/diagnostics/table.rs6.0MixedExplicit Debt: TodoComment
rpfm_lib/src/files/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui/src/global_search_ui/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui_common/src/icons/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_lib/src/files/db/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_extensions/src/diagnostics/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui/src/packedfile_views/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui/src/views/table/mod.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui/src/views/table/utils.rs6.0MixedExplicit Debt: TodoComment
rpfm_ui/src/tools/translator/mod.rs6.0MixedExplicit Debt: TodoComment

How the grades work

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

Critical — 39

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 1548

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 109

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

Could not be resolved — 12

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

Methodology & how to trust this report

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

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

What we checked — 57 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D17D19D20D26D28D29D30D34D35D36D43D44AC2AC3AC6AX10AX3AX4AX9ED1GD1IC1M1M2M3P1P10P2P3P4P6P7PF3S1X1X12X15X16X17X18X21X22X25X28X30X4X5

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1eaea-c420-7088-9e31-fdc431f5f91b.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 137 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (21 contributor(s) across 4995 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 20 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (rpfm_server). the service did not build — `cargo build --locked --bin 'rpfm_server'` exited 101: Updating crates.io index error: failed to get `cpp_core` as a dependency of package `rpfm_ui_common v5.3.3 (rpfm_ui_common)` Caused by: failed t…; runtime evidence skipped (launch chosen because 'axum' dependency in rpfm_server/Cargo.toml, binary 'rpfm_server').
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'rusqlite' is imported (rpfm_lib/src/schema/mod.rs:97), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'rusqlite' is imported (rpfm_lib/src/schema/mod.rs:97), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'rusqlite' is imported (rpfm_lib/src/schema/mod.rs:97), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'rusqlite' is imported (rpfm_lib/src/schema/mod.rs:97), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
  • X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 269 further occurrence(s) are not listed individually; the score already reflects all 309.
  • X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Kotlin, Scala, Go, Swift, Python and Ruby source only, and no C# was loaded, no Java, Kotlin, Scala, Go, Swift, Python or Ruby was found, and this repository's Lua is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 450 further occurrence(s) are not listed individually; the score already reflects all 490.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity3.0 / 10Weak✓ Tool-verified

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

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

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

162 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PackFileContentsSlots::new at 266. A further 46 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 rpfm_server::api::dispatch at 116 — they are counted neither in the figure above nor in this dimension's score. 14 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: rpfm_server/src/api.rs (rpfm_server::api::dispatch at 116), rpfm_lib/src/files/group_formations/versions/v1.rs (EntityType::try_from at 64), rpfm_lib/src/files/rigidmodel/materials/mod.rs (MaterialType::try_from at 57), rpfm_lib/src/files/sound_bank/sections/bkhd/mod.rs (Language::try_from at 40), rpfm_lib/src/files/cs2_parsed/mod.rs (EFLineType::try_from at 29), and 9 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

AppUI::open_packedfile (cyclomatic 99) · ×11rpfm_ui/src/app_ui/mod.rs:2019
TableView::set_data_on_cells (cyclomatic 45) · ×11rpfm_ui/src/views/table/mod.rs:2960
rpfm_ui::views::table::utils::build_columns (cyclomatic 43) · ×11rpfm_ui/src/views/table/utils.rs:745
Pack::optimize (cyclomatic 65) · ×10rpfm_extensions/src/optimizer/mod.rs:299
Cs2Parsed::read_v12 (cyclomatic 20) · ×10rpfm_lib/src/files/cs2_parsed/versions/v12.rs:22

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

What to do

  1. Bring the 5 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with PackFileContentsSlots::new (cyclomatic 266), AppUISlots::new (cyclomatic 146), Dependencies::generate_automatic_patches (cyclomatic 135). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cyclomatic Complexity from 3.0 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

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

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

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

332 method(s) exceeded the cognitive complexity threshold of 15; the worst was PackFileContentsSlots::new at 559.

Dependencies::generate_automatic_patches (cognitive 266) · ×24rpfm_extensions/src/dependencies/mod.rs:2584
TableView::set_data_on_cells (cognitive 128) · ×23rpfm_ui/src/views/table/mod.rs:2960
rpfm_extensions::merge::delta_merge_rows (cognitive 33) · ×23rpfm_extensions/src/merge/mod.rs:224
rpfm_ui::app_ui::slots::handle_tab_current_changed (cognitive 170) · ×22rpfm_ui/src/app_ui/slots.rs:243
Cs2Parsed::read_v12 (cognitive 57) · ×18rpfm_lib/src/files/cs2_parsed/versions/v12.rs:22

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

What to do

  1. Bring the 332 bodies over 15 down to 15 or less in Cognitive Complexity — start with PackFileContentsSlots::new (cognitive 559), rpfm_server::ceo_builder::build_ceo_entries (cognitive 489), AppUI::open_packedfile (cognitive 337). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 332 together lifts Cognitive Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D3 · God Classes7.7 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

196 god class(es) detected.

MethodTooLong: PackFileContentsSlots.new · ×87rpfm_ui/src/packfile_contents_ui/slots.rs:181
FileTooLong: app_ui/mod.rs · ×38rpfm_ui/src/app_ui/mod.rs
ClassTooLong: AppUI · ×27rpfm_ui/src/app_ui/mod.rs:195
TooManyFields: AppUI · ×21rpfm_ui/src/app_ui/mod.rs:195
TooManyMethods: SessionState · ×13rpfm_server/src/state/mod.rs:66

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

What to do

  1. Resolve the 87 MethodTooLong finding(s) in God Classes — start with mod.rs (54), slots.rs (14), sho2.rs (4). — One of this dimension's main actionable groups (87 warning-level).
  2. Resolve the 38 FileTooLong finding(s) in God Classes — start with mod.rs (25), slots.rs (3), utils.rs (2). — One of this dimension's main actionable groups (38 warning-level).
  3. Resolve the 27 ClassTooLong finding(s) in God Classes — start with mod.rs (21), slots.rs (4), server_mcp.rs. — One of this dimension's main actionable groups (27 warning-level).

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

D4 · Code Duplication7.1 / 10Strong✓ Tool-verified

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

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

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

400 duplicated block group(s) detected. 7.3 % of the production lines (11,917 of 163,685) are in a reported copy. A further 116 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (8 lines × 2) · ×34rpfm_extensions/src/dependencies/mod.rs:681
Duplicated block (7 lines × 2) · ×28rpfm_extensions/src/dependencies/mod.rs:527
Duplicated block (6 lines × 2) · ×24rpfm_extensions/src/startpos/world/mod.rs:468
Duplicated block (9 lines × 2) · ×23rpfm_extensions/src/dependencies/mod.rs:1263
Duplicated block (5 lines × 2) · ×23rpfm_extensions/src/dependencies/mod.rs:1307

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

What to do

  1. Resolve the 34 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (27), slots.rs (5), atlas.rs. — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 28 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with mod.rs (22), utils.rs (3), slots.rs (2). — One of this dimension's main actionable groups (28 warning-level).
  3. Resolve the 24 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with mod.rs (17), ceo_builder.rs (3), utils.rs (2). — One of this dimension's main actionable groups (24 warning-level).

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

D5 · Coupling6.6 / 10Adequate✓ Tool-verified

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

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

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

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

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

Off the main sequence: rpfm_telemetry · ×3

What to do

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

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

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 8 serious findings✓ Tool-verified

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

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

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

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

8 of 291 classes have LCOM4 above 3.

Low cohesion: Tool (LCOM4 15) · ×8rpfm_ui/src/tools/mod.rs:139

What to do

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

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

D12 · Dependency Hygiene8.6 / 10Strong✓ Tool-verified

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

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

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

29 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: anyhow · ×29

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

1 of 735 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository.

Banned license: evalexpr

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).

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

D15 · Churn × Complexity Hotspots8.9 / 10Strong✓ Tool-verified

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

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

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

Top hotspots: rpfm_ui/src/packfile_contents_ui/slots.rs (16×266=4256); rpfm_ui/src/app_ui/mod.rs (29×99=2871); rpfm_ui/src/app_ui/slots.rs (16×146=2336)

Hotspot: rpfm_ui/src/packfile_contents_ui/slots.rs · ×29rpfm_ui/src/packfile_contents_ui/slots.rs:181

What to do

  1. Resolve the 29 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (14), slots.rs (5), utils.rs. — One of this dimension's main actionable groups (29 warning-level).

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

D17 · Explicit Debt9.9 / 10Stronggated by 48 serious findings✓ Tool-verified

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

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

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

48 deducted task-comment markers across 163685 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×46rpfm_ui_common/src/icons/mod.rs:237
FixmeComment · ×2rpfm_lib/src/files/dat/mod.rs:146

What to do

  1. Resolve the 46 TodoComment finding(s) in Explicit Debt — start with mod.rs (24), slots.rs (7), cs2_parsed_test.rs (2). — One of this dimension's main actionable groups (46 warning-level).
  2. Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with mod.rs (2). — One of this dimension's main actionable groups (2 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 60 document(s) read across 8 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

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

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

No architecture decision records were found.

No ADRs foundREDACTED:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion2.5 / 10Weak✓ Tool-verified

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

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

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

3 of 8 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×3rpfm_lib/Cargo.toml:1

What to do

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

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

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)3.2 / 10Weak✓ Tool-verified

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

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

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

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

24 finding(s): 0 critical, 19 high, 5 medium, 0 low. 14 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 6 file(s) — `3rdparty/src/qt_rpfm_extensions/include/filter_header_view.h` (line 16, line 18), `3rdparty/src/qt_rpfm_extensions/include/qt_long_long_spinbox.h` (line 29, line 54, line 57), `3rdparty/src/qt_rpfm_extensions/include/responsive_widget.h` (line 16, line 18), `3rdparty/src/qt_rpfm_extensions/include/tableview_filter.h` (line 67), `3rdparty/src/qt_rpfm_extensions/include/tableview_frozen.h` (line 17, line 47, line 50), … (+1 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.6 / 10Adequategated by 8 critical findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: background_thread.rs↔mod.rs 87%; connections.rs↔tips.rs 75%; slots.rs↔tips.rs 75%

Boundary-crossing change coupling: background_thread.rs ↔ mod.rs · ×8rpfm_server/src/background_thread.rs:1
Change coupling: connections.rs ↔ tips.rs · ×7rpfm_ui/src/app_ui/connections.rs:1
Change-coupling hub: slots.rs → tips.rs, slots.rs, mod.rsrpfm_ui/src/app_ui/slots.rs

What to do

  1. Resolve the 8 Boundary-crossing change coupling finding(s) in Change Coupling — start with background_thread.rs (7), helpers.rs. — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 7 Change coupling finding(s) in Change Coupling — start with mod.rs (4), connections.rs (2), reader.rs. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with slots.rs. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

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

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

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

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

AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

  • `.cta` moves (`transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 80ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/style.css:168
  • `.cta-split-toggle svg` moves (`transition: transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/style.css:227
  • `.feature` moves (`transition: border-color 160ms ease, transform 160ms ease, background 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/style.css:328

What to do

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

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

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

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

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

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

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

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

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

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

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ED1 · Handler temporal coupling7.4 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

  • `Settings.read_from` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — rpfm_ipc/src/settings.rs:366
  • `Settings.load_or_recover` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — rpfm_ipc/src/settings.rs:389, rpfm_ipc/src/settings.rs:401
  • `Settings.load_or_recover` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — rpfm_ipc/src/settings.rs:400
  • `settings.custom_config_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — rpfm_ipc/src/settings.rs:667
  • `settings.init_config_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::create`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — rpfm_ipc/src/settings.rs:728

What to do

  • Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of 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.

  • `apply` is a shipped function whose whole body is still `todo!()`/`unimplemented!()` — generated scaffolding that was never completed. Implement it or remove the dead surface. — rpfm_extensions/src/translator/mod.rs:572

What to do

  • Finish or delete the functions that are still `todo!()`/`unimplemented!()` or panic "not implemented", and replace placeholder text before shipping.
IC1 · Incompleteness & stubs5.4 / 10Adequate✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×9) — rpfm_extensions/src/search/mod.rs:629, rpfm_extensions/src/search/mod.rs:650, rpfm_extensions/src/search/mod.rs:670, …
  • `apply` is a shipped function whose whole body is `todo!()`/`unimplemented!()` — scaffolding that was never completed, and a panic on the first call. Implement it or remove the dead surface. — rpfm_extensions/src/translator/mod.rs:572
  • `encode` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rpfm_lib/src/files/cs2_collision/mod.rs:323, rpfm_lib/src/files/cs2_parsed/mod.rs:845, rpfm_lib/src/files/portrait_settings/mod.rs:206
  • `table_name_without_tables` does real work, but one of its branches is `panic!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/files/db/mod.rs:397
  • `save_node` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/files/esf/utils.rs:679
  • `from` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/files/mod.rs:3195
  • `read_rs_river` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — rpfm_lib/src/files/rigidmodel/materials/rs_river.rs:18
  • `write_rs_river` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — rpfm_lib/src/files/rigidmodel/materials/rs_river.rs:21
  • `read` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rpfm_lib/src/files/sound_bank/common/mod.rs:80, rpfm_lib/src/files/sound_bank/common/mod.rs:82, rpfm_lib/src/files/sound_bank/common/mod.rs:112
  • `write` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rpfm_lib/src/files/sound_bank/common/mod.rs:134, rpfm_lib/src/files/sound_bank/common/mod.rs:136, rpfm_lib/src/files/sound_bank/common/mod.rs:166
  • `decode_field_postprocess` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rpfm_lib/src/files/table/mod.rs:1433, rpfm_lib/src/files/table/mod.rs:1449, rpfm_lib/src/files/table/mod.rs:1467
  • `decode` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/files/uic/mod.rs:268
  • `encode` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×2) — rpfm_lib/src/files/uic/mod.rs:278, rpfm_lib/src/files/uic/mod.rs:280
  • `to_table` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/integrations/assembly_kit/table_data.rs:489
  • `from` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/integrations/assembly_kit/table_definition.rs:890
  • `closest_valid_char_byte` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_lib/src/utils.rs:139
  • `notify` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rpfm_server/src/jobs.rs:229
  • `build_open_mymod_submenus` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_ui/src/app_ui/mod.rs:1981
  • `open_packedfile` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_ui/src/app_ui/mod.rs:2065
  • `new_file_dialog` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rpfm_ui/src/app_ui/mod.rs:3117, rpfm_ui/src/app_ui/mod.rs:3232, rpfm_ui/src/app_ui/mod.rs:3294
  • `new` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — rpfm_ui/src/app_ui/slots.rs:974

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
M1 · Documentation (README)9.3 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

P2 · Observability7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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 cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:6
  • `Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — Cargo.toml:56

What to do

  • Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — 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.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

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

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

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

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

  • `reqwest::blocking::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rpfm_ui/src/session_ui/mod.rs:191
  • `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rpfm_ui/src/tools/translator/mod.rs:1209
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rpfm_ui/src/tools/translator/mod.rs:1287

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

S1 · Web-Security Posture4.0 / 10Weak✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (REDACTED:198)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).
  • No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
  • Validate what the server reads from a request — path, query, headers, body size and shape — and answer what fails with 400 (413 for an oversized body) before a handler acts on it: derive `validator::Validate` (or `garde::Validate`) on the request types and reject with `StatusCode::BAD_REQUEST`, and cap bodies with `DefaultBodyLimit::max`/`RequestBodyLimitLayer` or actix's `JsonConfig::default().limit(…)`.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader1.2 / 10Critical✓ Tool-verified

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

  • `num_frames` is read from the bytes being parsed at line 47 (`read_u32`), then used to size a `Vec::with_capacity` at line 53 — and nowhere in its scope is `num_frames` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `num_frames` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/video/ivf.rs:53
  • `variants_on_this_category` is read from the bytes being parsed at line 184 (`read_u32`), then used to size a `Vec::with_capacity` at line 190 — and nowhere in its scope is `variants_on_this_category` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `variants_on_this_category` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/unit_variant/mod.rs:190
  • `mesh_count` is read from the bytes being parsed at line 43 (`read_u32`), then used to size a `Vec::with_capacity` at line 44 — and nowhere in its scope is `mesh_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `mesh_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/versions/v6.rs:44
  • `vertex_count` is read from the bytes being parsed at line 76 (`read_u32`), then used to size a `Vec::with_capacity` at line 94 — and nowhere in its scope is `vertex_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `vertex_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/versions/v6.rs:94
  • `index_count` is read from the bytes being parsed at line 78 (`read_u32`), then used to size a `Vec::with_capacity` at line 95 — and nowhere in its scope is `index_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `index_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/versions/v6.rs:95
  • `mesh_count` is read from the bytes being parsed at line 36 (`read_u32`), then used to size a `Vec::with_capacity` at line 37 — and nowhere in its scope is `mesh_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `mesh_count` against the bytes actually remaining and a maximum the format allows before allocating. (×2) — rpfm_lib/src/files/rigidmodel/versions/v7.rs:37, rpfm_lib/src/files/rigidmodel/versions/v8.rs:37
  • `vertex_count` is read from the bytes being parsed at line 63 (`read_u32`), then used to size a `Vec::with_capacity` at line 75 — and nowhere in its scope is `vertex_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `vertex_count` against the bytes actually remaining and a maximum the format allows before allocating. (×2) — rpfm_lib/src/files/rigidmodel/versions/v7.rs:75, rpfm_lib/src/files/rigidmodel/versions/v8.rs:75
  • `index_count` is read from the bytes being parsed at line 65 (`read_u32`), then used to size a `Vec::with_capacity` at line 76 — and nowhere in its scope is `index_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `index_count` against the bytes actually remaining and a maximum the format allows before allocating. (×2) — rpfm_lib/src/files/rigidmodel/versions/v7.rs:76, rpfm_lib/src/files/rigidmodel/versions/v8.rs:76
  • `uk_7_count` is read from the bytes being parsed at line 22 (`read_u32`), then used to size a `Vec::with_capacity` at line 23 — and nowhere in its scope is `uk_7_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_7_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/cloth.rs:23
  • `uk_8_count` is read from the bytes being parsed at line 25 (`read_u32`), then used to size a `Vec::with_capacity` at line 26 — and nowhere in its scope is `uk_8_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_8_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/cloth.rs:26
  • `uk_9_count` is read from the bytes being parsed at line 28 (`read_u32`), then used to size a `Vec::with_capacity` at line 29 — and nowhere in its scope is `uk_9_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_9_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/cloth.rs:29
  • `attachment_points_count` is read from the bytes being parsed at line 51 (`read_u32`), then used to size a `Vec::with_capacity` at line 52 — and nowhere in its scope is `attachment_points_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `attachment_points_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:52
  • `texture_count` is read from the bytes being parsed at line 54 (`read_u32`), then used to size a `Vec::with_capacity` at line 55 — and nowhere in its scope is `texture_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `texture_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:55
  • `param_string_count` is read from the bytes being parsed at line 57 (`read_u32`), then used to size a `Vec::with_capacity` at line 58 — and nowhere in its scope is `param_string_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_string_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:58
  • `param_f32_count` is read from the bytes being parsed at line 60 (`read_u32`), then used to size a `Vec::with_capacity` at line 61 — and nowhere in its scope is `param_f32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_f32_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:61
  • `param_i32_count` is read from the bytes being parsed at line 63 (`read_u32`), then used to size a `Vec::with_capacity` at line 64 — and nowhere in its scope is `param_i32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_i32_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:64
  • `param_vector4df32_count` is read from the bytes being parsed at line 66 (`read_u32`), then used to size a `Vec::with_capacity` at line 67 — and nowhere in its scope is `param_vector4df32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_vector4df32_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/default.rs:67
  • `node_count` is read from the bytes being parsed at line 24 (`read_u32`), then used to size a `Vec::with_capacity` at line 30 — and nowhere in its scope is `node_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `node_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/rope.rs:30
  • `bone_count` is read from the bytes being parsed at line 25 (`read_u32`), then used to size a `Vec::with_capacity` at line 27 — and nowhere in its scope is `bone_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `bone_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/rigidmodel/materials/weighted_cloth.rs:27
  • `define_count` is read from the bytes being parsed at line 26 (`read_u32`), then used to size a `Vec::with_capacity` at line 27 — and nowhere in its scope is `define_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `define_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/fxc/v4.rs:27
  • `include_count` is read from the bytes being parsed at line 36 (`read_u32`), then used to size a `Vec::with_capacity` at line 37 — and nowhere in its scope is `include_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `include_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/fxc/v4.rs:37
  • `category_count` is read from the bytes being parsed at line 41 (`read_u32`), then used to size a `Vec::with_capacity` at line 42 — and nowhere in its scope is `category_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `category_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/asset_variation_db/v1.rs:42
  • `entry_count` is read from the bytes being parsed at line 52 (`read_u32`), then used to size a `Vec::with_capacity` at line 53 — and nowhere in its scope is `entry_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `entry_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/asset_variation_db/v1.rs:53
  • `variation_count` is read from the bytes being parsed at line 58 (`read_u32`), then used to size a `Vec::with_capacity` at line 59 — and nowhere in its scope is `variation_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `variation_count` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/files/asset_variation_db/v1.rs:59
  • `u_size` is read from the bytes being parsed at line 228 (`read_u32`), then used to size a `Vec::with_capacity` at line 264 — and nowhere in its scope is `u_size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `u_size` against the bytes actually remaining and a maximum the format allows before allocating. — rpfm_lib/src/compression/mod.rs:264

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document1.2 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `encode` is public and takes a `RFile` as its receiver from its caller, and it calls itself at line 2368 with a piece of the document (and at line 2369, line 2370, line 2371, line 2372, line 2373, line 2374, line 2375, line 2376, line 2377, line 2378, line 2379, line 2380, line 2381, line 2382, line 2383, line 2384, line 2385, line 2386, line 2387, line 2388, line 2389, line 2390, line 2391, line 2392, line 2393, line 2394, line 2395, line 2396) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/mod.rs:2368
  • `update` is public and takes a `RFile` as its receiver from its caller, and it calls itself at line 2863 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `update` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/mod.rs:2863
  • `insert` is public and takes a `Pack` as its receiver from its caller, and it recurses at line 444 through `write`, `encode` and back with a piece of the document (and at line 431, line 434, line 437, line 564, line 745, line 751, line 757) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `insert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:444
  • `pfh_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1033 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `pfh_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1033
  • `pfh_file_type` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1038 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `pfh_file_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1038
  • `bitmask` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1043 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `bitmask` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1043
  • `internal_timestamp` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1048 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `internal_timestamp` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1048
  • `game_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1053 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `game_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1053
  • `build_number` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1058 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `build_number` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1058
  • `authoring_tool` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1063 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `authoring_tool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1063
  • `extra_subheader_data` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1068 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `extra_subheader_data` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1068
  • `set_pfh_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1092 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_pfh_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1092
  • `set_pfh_file_type` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1097 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_pfh_file_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1097
  • `set_bitmask` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1102 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_bitmask` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1102
  • `set_internal_timestamp` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1107 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_internal_timestamp` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1107
  • `set_game_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1112 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_game_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1112
  • `set_build_number` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1117 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_build_number` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1117
  • `set_authoring_tool` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1122 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_authoring_tool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1122
  • `set_extra_subheader_data` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1127 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_extra_subheader_data` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/pack/mod.rs:1127
  • `save_node` is public and takes `node_type: &NodeType` from its caller, and it calls itself at line 1069 with a piece of the document (and at line 1084) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `save_node` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/esf/utils.rs:1069
  • `read_string_from_node` is public and takes `node_type: &NodeType` from its caller, and it calls itself at line 1137 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `read_string_from_node` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/esf/utils.rs:1137
  • `encode` is public and takes a `AnimPack` as its receiver from its caller, and it calls itself at line 408 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rpfm_lib/src/files/animpack/mod.rs:408

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness4.7 / 10Weak✓ Tool-verified

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

  • `file` (line 68) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_ui_common/src/tools/mod.rs:68
  • `file` (line 1252) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_ui/src/views/table/mod.rs:1252
  • `file` (line 404) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_telemetry/src/logger.rs:404
  • `file` (line 847) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_server/src/state/tools.rs:847
  • `file` (line 860) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_server/src/state/tools.rs:860
  • `file` (line 875) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_server/src/state/tools.rs:875
  • `file` (line 618) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/schema/mod.rs:618
  • `file` (line 647) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/schema/mod.rs:647
  • `file` (line 682) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/schema/mod.rs:682
  • `file` (line 1007) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/schema/mod.rs:1007
  • `file` (line 1078) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/schema/mod.rs:1078
  • `file` (line 169) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/integrations/git.rs:169
  • `file` (line 2896) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/files/mod.rs:2896
  • `file` (line 1462) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/files/pack/mod.rs:1462
  • `terry_file` (line 574) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/files/bmd/mod.rs:574
  • `layer_file` (line 691) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_lib/src/files/bmd/mod.rs:691
  • `file` (line 427) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_ipc/src/settings.rs:427
  • `file` (line 728) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_ipc/src/settings.rs:728
  • `file` (line 705) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_extensions/src/translator/mod.rs:705
  • `file` (line 317) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_extensions/src/startpos/layout.rs:317
  • `Box::<[T]>::into_raw(alloc)` (line 619) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and nothing in the crate's code ever reclaims a `Box` from a raw pointer (`Box::from_raw`). The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value. — rpfm_extensions/src/gltf/mod.rs:619
  • `writer_gltf` (line 494) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — rpfm_extensions/src/gltf/mod.rs:494

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

  • `TableReferences.referenced_table_is_ak_only` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/dependencies/mod.rs:315
  • `TableReferences.referenced_column_is_localised` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/dependencies/mod.rs:322
  • `Diagnostics.folders_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/diagnostics/mod.rs:187
  • `Diagnostics.files_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/diagnostics/mod.rs:190
  • `Diagnostics.fields_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/diagnostics/mod.rs:195
  • `LuaTestOptions.faction_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:90
  • `LuaTestReport.boot_errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:106
  • `LuaSave.errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:118
  • `LuaTestResult.passed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:138
  • `LuaTestResult.errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:142
  • `LuaTestResult.unmocked_calls` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:146
  • `LuaTestResult.log` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/lua/harness/mod.rs:149
  • `MergeOptions.delta_merge` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/merge/mod.rs:53
  • `GlobalSearch.game_key` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/search/mod.rs:253
  • `SettlementLayout.sprawl` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:52
  • `SlotLayout.walls` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:93
  • `SlotLayout.touching_slots` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:98
  • `SprawlCell.in_footprint` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:110
  • `SprawlCell.in_zone` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:113
  • `SprawlCell.zone_slots` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/settlements.rs:116
  • `NetworkSpline.speed_tables` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/trade.rs:74
  • `NetworkSpline.lengths` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/trade.rs:77
  • `NetworkSpline.total_length` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/startpos/trade.rs:80
  • `PackTranslation.glossary` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_extensions/src/translator/mod.rs:179
  • `FilesExtracted.extracted` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/files.rs:354
  • `RowLocs.locs` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/references.rs:178
  • `UnusedNumbers.numbers` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:406
  • `TablesMerged.conflicts` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:458
  • `TableUpgraded.old_version` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:478
  • `TableUpgraded.new_version` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:481
  • `TableUpgraded.deleted_columns` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:484
  • `TableUpgraded.added_columns` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tables.rs:487
  • `StartposTableComparison.match_ratio` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tools.rs:408
  • `StartposValueDifference.original` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tools.rs:448
  • `StartposValueDifference.extracted` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/api/tools.rs:451
  • `DependenciesInfo.parent_packed_files` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/helpers.rs:175
  • `SessionInfo.timeout_remaining_secs` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/helpers.rs:260
  • `SessionInfo.is_shutting_down` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_ipc/src/helpers.rs:263
  • `CaptureLocation.valid_for_min_num_players` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_lib/src/files/bmd/capture_location_set/mod.rs:50
  • `CaptureLocation.valid_for_max_num_players` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rpfm_lib/src/files/bmd/capture_location_set/mod.rs:51

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging1.9 / 10Critical✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info!` at line 1222 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1222
  • `info!` at line 1257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1257
  • `info!` at line 1288 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1288
  • `info!` at line 1322 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1322
  • `info!` at line 1632 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1632
  • `info!` at line 1645 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1645
  • `info!` at line 1649 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/ceo_builder.rs:1649
  • `info!` at line 197 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — REDACTED:197
  • `warn!` at line 201 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — REDACTED:201
  • `info!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — REDACTED:248
  • `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:93
  • `info!` at line 115 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:115
  • `info!` at line 117 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:117
  • `warn!` at line 183 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:183
  • `info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:207
  • `info!` at line 213 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — rpfm_server/src/server_websocket.rs:213, rpfm_server/src/session.rs:213
  • `info!` at line 229 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:229
  • `info!` at line 237 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/server_websocket.rs:237
  • `info!` at line 215 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:215
  • `error!` at line 219 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:219
  • `info!` at line 307 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:307
  • `info!` at line 310 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:310
  • `info!` at line 382 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:382
  • `info!` at line 393 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:393
  • `info!` at line 536 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:536
  • `info!` at line 555 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:555
  • `info!` at line 583 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:583
  • `info!` at line 615 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:615
  • `info!` at line 642 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/session.rs:642
  • `info!` at line 311 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/mod.rs:311
  • `warn!` at line 488 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/packs.rs:488
  • `warn!` at line 498 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/packs.rs:498
  • `warn!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/tools.rs:248
  • `info!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/tools.rs:316
  • `error!` at line 406 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/tools.rs:406
  • `info!` at line 420 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/tools.rs:420
  • `warn!` at line 422 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rpfm_server/src/state/tools.rs:422

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types8.9 / 10Strong✓ Tool-verified

Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • `FluentResource::try_new(String::new())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `initialize_empty` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui_common/src/locale.rs:99
  • `bundle.add_resource(resource)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `initialize_empty` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui_common/src/locale.rs:101
  • `file.file_stem()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `get_available_locales` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui_common/src/locale.rs:109
  • `Ref::from_raw(ptr.load(Ordering::SeqCst))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `ref_from_atomic` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui_common/src/utils/mod.rs:73
  • `Ref::from_raw(ptr.load(Ordering::SeqCst))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `ref_from_atomic_ref` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui_common/src/utils/mod.rs:77
  • `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×5) — rpfm_ui/build.rs:43, rpfm_ui/build.rs:63, rpfm_ui/build.rs:101, …
  • `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×5) — rpfm_ui/build.rs:44, rpfm_ui/build.rs:64, rpfm_ui/build.rs:102, …
  • `stdout().write_all(error.to_string().as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×5) — rpfm_ui/build.rs:47, rpfm_ui/build.rs:91, rpfm_ui/build.rs:115, …
  • `stdout().write_all(b"ERROR: You either don't have nuget installed, it's not in the path, or there was an error while executing it. Download it from here (https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) and drop it in the root of the repo to continue.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:48
  • `copy(renderer_path.to_owned()+"x64/Release/ImportExport.lib","./../3rdparty/builds/ImportExport.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:76
  • `copy(renderer_path.to_owned()+"x64/Release/QtRenderingWidget.lib","./../3rdparty/builds/QtRenderingWidget.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:77
  • `copy(renderer_path.to_owned()+"x64/Release/Rldx.lib","./../3rdparty/builds/Rldx.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:78
  • `std::fs::remove_dir_all(&assets_path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:83
  • `fs_extra::dir::copy(renderer_path.to_owned()+"Rldx/Rldx/RenderResources","./../",&copy_options)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:87
  • `std::fs::rename("./../RenderResources",assets_path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:88
  • `stdout().write_all(b"ERROR: You either don't have msbuild installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:92
  • `stdout().write_all(b"ERROR: You either don't have nmake installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:116
  • `String::from_utf8(output.stderr.to_vec())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — rpfm_ui/build.rs:142, rpfm_ui/build.rs:168
  • `stdout().write_all(b"ERROR: You either don't have make installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:149
  • `stdout().write_all(b"ERROR: You either don't have gmake installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:175
  • `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `common_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:221
  • `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `common_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:222
  • `stdout().write_all(error.to_string().as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `common_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:235
  • `stdout().write_all(b"ERROR: You either don't have qmake installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `common_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/build.rs:236
  • `Runtime::new()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:175
  • `Logger::init(&PathBuf::from("."),true,true,release_name!())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:181
  • `path.file_name()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_recent_files` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rpfm_ui/src/welcome_page_ui/mod.rs:380

What to do

  • Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

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

Reference — by lens

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

LensScoreRatingImpact
Code Health54.4Adequate — gated by D1, D2, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture88.5Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity67.7Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness48.9Weak — gated by P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security45.6Weak — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven74.1StrongSolid.
Accessibility78.6StrongSolid.
Performance100.0ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 22 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: this repository stores data through 'rusqlite' (rpfm_lib/src/schema/mod.rs:97) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'rusqlite' (rpfm_lib/src/schema/mod.rs:97) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'rusqlite' (rpfm_lib/src/schema/mod.rs:97) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — no interface, protocol or abstract type declares an operation an implementer must write
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the service did not build — `cargo build --locked --bin 'rpfm_server'` exited 101: Updating crates.io index error: failed to get `cpp_core` as a dependency of package `rpfm_ui_common v5.3.3 (rpfm_ui_common)` Caused by: failed t…; runtime evidence skipped (launch chosen because 'axum' dependency in rpfm_server/Cargo.toml, binary 'rpfm_server') This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: this repository stores data through 'rusqlite' (rpfm_lib/src/schema/mod.rs:97) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D10 Test Quality — ~10633 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 4 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py, .rs source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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 project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Rust suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (51 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • 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 lens looks for
  • M4 Documentation accuracy — Not applicable: the 60 current-state document(s) make no claim of a kind M4 checks. 32 claim(s) of kinds M4 does not check were not checked (path 10, command argument 7, environment variable 11, setting 2, cd 2); M4 checks only links and versions and artefact counts.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Rust was read, and no request in it can be cancelled by a caller — a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 39 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×8
  • Boundary-crossing change coupling: background_thread.rs ↔ mod.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/communications/mod.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 87% of the time (216 of the 249 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 216 shared commits counted here, the most recent 3 are `a1204036` Moved the file operations of the Qt UI to the version 2 server API.; `7d601c5c` Moved the file info queries of the Qt UI to the version 2 server API.; `4816131b` Moved the file decoding and saving of the Qt UI views to the version … — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ slots.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/packedfile_views/rigidmodel/slots.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f5d01420` Expanded ui, and added some limited texture support for the gltf expo… (at that commit the file was still `rpfm_ui/src/background_thread.rs`); `af2b324b` Migrated UI to use the new WIP rigidmodel editor. (at that commit the file was still `rpfm_ui/src/background_thread.rs`); `ac145f2c` Fix warnings. (at that commit the file was still `rpfm_ui/src/background_thread.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: helpers.rs ↔ background_thread.rs rpfm_ipc/src/helpers.rs:1 — `rpfm_ipc/src/helpers.rs` (context rpfm_ipc) and `rpfm_server/src/background_thread.rs` (context rpfm_server) sit in DIFFERENT parts of the tree yet change together 57% of the time (12 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `a1204036` Moved the file operations of the Qt UI to the version 2 server API.; `55fc1e0e` Moved the pack lifecycle of the Qt UI to the version 2 server API.; `253a2a14` Moved the tools of the Qt UI to the version 2 server API. — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ connections.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/app_ui/connections.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 55% of the time (41 of the 74 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 41 shared commits counted here, the most recent 3 are `97d443eb` Moved autosaving from the UI to the server, so it never makes the UI …; `6f18f39c` Cleanup of the CEOs feature.; `92850793` Merge pull request #337 from Ironictw2st/ceos — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ mod.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/packedfile_views/packfile_settings/mod.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `55fc1e0e` Moved the pack lifecycle of the Qt UI to the version 2 server API.; `1c4e5a14` Multicommit: - Fixed missing/misalinged text in Pack Settings View. -… (at that commit the file was still `rpfm_ui/src/background_thread.rs`); `895c5c0c` Partially restored cascade edition functionality (missing loc support). (at that commit the file was still `rpfm_ui/src/background_thread.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ mod.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/references_ui/mod.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c1614fb9` Moved the references of the Qt UI to the version 2 server API.; `a228d0a3` Fixed a few more instances of stuff broken due to multipack support: …; `ace88fc9` Initial implementation for Copy/Cut/Paste/Duplicate operations. — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ connections.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/packfile_contents_ui/connections.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 54% of the time (25 of the 46 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `64e4b8e2` Implemented pack encryption.; `d1389177` Added experimental script processing.; `92850793` Merge pull request #337 from Ironictw2st/ceos — run `git show` on any of them.
  • Boundary-crossing change coupling: background_thread.rs ↔ slots.rs rpfm_server/src/background_thread.rs:1 — `rpfm_server/src/background_thread.rs` (context rpfm_server) and `rpfm_ui/src/packedfile_views/packfile/slots.rs` (context rpfm_ui) sit in DIFFERENT parts of the tree yet change together 52% of the time (14 of the 27 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `a1204036` Moved the file operations of the Qt UI to the version 2 server API.; `ace88fc9` Initial implementation for Copy/Cut/Paste/Duplicate operations.; `7c409c5c` Restored Upload/Import Definition Patch. (at that commit the file was still `rpfm_ui/src/background_thread.rs`) — run `git show` on any of them.
ED1 · Handler temporal coupling · Blocking call on the event loop · ×6
  • Blocking call on the event loop: Settings.read_from calls `File::open` rpfm_ipc/src/settings.rs:366 — `Settings.read_from` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: Settings.load_or_recover calls `std::fs::copy` rpfm_ipc/src/settings.rs:389 — `Settings.load_or_recover` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: Settings.load_or_recover calls `std::fs::metadata` rpfm_ipc/src/settings.rs:400 — `Settings.load_or_recover` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: Settings.load_or_recover calls `std::fs::copy` rpfm_ipc/src/settings.rs:401 — `Settings.load_or_recover` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: settings.custom_config_path calls `std::fs::read_to_string` rpfm_ipc/src/settings.rs:667 — `settings.custom_config_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: settings.init_config_path calls `File::create` rpfm_ipc/src/settings.rs:728 — `settings.init_config_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::create`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · High secret · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
D14 · License Compliance · Banned license · ×1
  • Banned license: evalexpr — `evalexpr` 13.1.0 is published on crates.io under `AGPL-3.0-only`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 1548 finding(s)
D3 · God Classes · MethodTooLong · ×87
  • MethodTooLong: PackFileContentsSlots.new rpfm_ui/src/packfile_contents_ui/slots.rs:181 — MethodTooLong — new runs 1527 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1427 over it, 15.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SupportedGames.default rpfm_lib/src/games/supported_games.rs:232 — MethodTooLong — default runs 1192 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1092 over it, 11.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppUISlots.new rpfm_ui/src/app_ui/slots.rs:475 — MethodTooLong — new runs 949 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 849 over it, 9.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TableViewSlots.new rpfm_ui/src/views/table/slots.rs:122 — MethodTooLong — new runs 575 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 475 over it, 5.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TableView.new_view rpfm_ui/src/views/table/mod.rs:398 — MethodTooLong — new_view runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppUI.open_packedfile rpfm_ui/src/app_ui/mod.rs:2019 — MethodTooLong — open_packedfile runs 402 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 302 over it, 4.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DB.generate_twad_key_deletes_keys rpfm_lib/src/files/db/mod.rs:720 — MethodTooLong — generate_twad_key_deletes_keys runs 395 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 295 over it, 3.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SettingsUI.new_with_parent rpfm_ui/src/settings_ui/mod.rs:222 — MethodTooLong — new_with_parent runs 392 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ESFDetailedView.load_to_detailed_view rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:125 — MethodTooLong — load_to_detailed_view runs 384 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 284 over it, 3.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GroupFormationsSlots.new rpfm_ui/src/packedfile_views/group_formations/slots.rs:111 — MethodTooLong — new runs 370 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 270 over it, 3.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ToolTranslator.new rpfm_ui/src/tools/translator/mod.rs:294 — MethodTooLong — new runs 369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppUI.new rpfm_ui/src/app_ui/mod.rs:382 — MethodTooLong — new runs 350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DiagnosticsUI.load_diagnostics_to_ui rpfm_ui/src/diagnostics_ui/mod.rs:711 — MethodTooLong — load_diagnostics_to_ui runs 343 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackedFileDecoderViewSlots.new rpfm_ui/src/packedfile_views/decoder/slots.rs:105 — MethodTooLong — new runs 338 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 238 over it, 3.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SoundBankDatabase.write_sho2 rpfm_lib/src/files/sound_bank_database/games/sho2.rs:567 — MethodTooLong — write_sho2 runs 332 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 232 over it, 3.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnimFragmentBattle.search rpfm_extensions/src/search/anim_fragment_battle.rs:93 — MethodTooLong — search runs 326 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 226 over it, 3.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ESF.read_node rpfm_lib/src/files/esf/utils.rs:77 — MethodTooLong — read_node runs 322 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DiagnosticsUI.new rpfm_ui/src/diagnostics_ui/mod.rs:246 — MethodTooLong — new runs 283 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 183 over it, 2.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ESF.save_node rpfm_lib/src/files/esf/utils.rs:675 — MethodTooLong — save_node runs 277 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SoundBankDatabase.read_sho2 rpfm_lib/src/files/sound_bank_database/games/sho2.rs:15 — MethodTooLong — read_sho2 runs 275 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackedFileDecoderView.new_view rpfm_ui/src/packedfile_views/decoder/mod.rs:174 — MethodTooLong — new_view runs 259 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 159 over it, 2.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PortraitSettingsView.new_view rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:191 — MethodTooLong — new_view runs 253 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackFileContentsUI.new rpfm_ui/src/packfile_contents_ui/mod.rs:201 — MethodTooLong — new runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dependencies.generate_automatic_patches rpfm_extensions/src/dependencies/mod.rs:2584 — MethodTooLong — generate_automatic_patches runs 238 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TableDiagnostic.check_db rpfm_extensions/src/diagnostics/table.rs:239 — MethodTooLong — check_db runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 62 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×46
  • TodoComment rpfm_ui_common/src/icons/mod.rs:237 — // TODO: detect .bin files for maps and campaign. — 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 rpfm_ui/src/views/table/mod.rs:2353 — // TODO: This is still very slow. We need some kind of range optimization. — 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 rpfm_ui/src/views/table/utils.rs:1168 — // TODO: Rework the enum system to work like lookups. — 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 rpfm_ui/src/tools/mod.rs:584 — // TODO: Make this work with multi-key columns. — 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 rpfm_ui/src/tools/unit_editor/variant_unit_editor/slots.rs:235 — // TODO: Make this check against the full key list, not just a subset. — 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 rpfm_ui/src/tools/translator/mod.rs:834 — // TODO: Old games need to overwrite the localisation.loc file instead of using a custom loc file. — 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 rpfm_ui/src/tools/faction_painter/mod.rs:144 — // TODO: Move this to a tool var. — 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 rpfm_ui/src/tools/faction_painter/mod.rs:718 — // TODO: change this so it's not done on EVERY SINGLE ROW. — 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 rpfm_ui/src/packfile_contents_ui/mod.rs:689 — // TODO: Validator to ensure than on multifile edit {x} is used as long as more than one file shares folder with another one. — 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 rpfm_ui/src/packfile_contents_ui/slots.rs:255 — // TODO: Filter out reserved files with some generic logic. — 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 rpfm_ui/src/packfile_contents_ui/slots.rs:1335 — // TODO: Filter out reserved files with some generic logic. — 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 rpfm_ui/src/packedfile_views/mod.rs:248 — // TODO: Move notes on this exact path to the new path. — 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 rpfm_ui/src/packedfile_views/mod.rs:445 — // TODO: move this out of here, as it can (and will) fail on broken jsons. — 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 rpfm_ui/src/packedfile_views/vmd/slots.rs:54 — // TODO: calculate a checksum of the file to also detect when it has gone back to its "unmodified" state. — 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 rpfm_ui/src/packedfile_views/text/slots.rs:56 — // TODO: calculate a checksum of the file to also detect when it has gone back to its "unmodified" state. — 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 rpfm_ui/src/packedfile_views/bmd/slots.rs:51 — // TODO: calculate a checksum of the file to also detect when it has gone back to its "unmodified" state. — 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 rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:143 — // TODO: check this returns the exact same ESF if there are no changes. — 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 rpfm_ui/src/packedfile_views/decoder/slots.rs:588 — // TODO: Rework this into a backend call. No reason to do it in the view. — 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 rpfm_ui/src/pack_tree/mod.rs:378 — //TODO: This needs heavy optimization. — 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 rpfm_ui/src/pack_tree/mod.rs:1594 — // TODO: Investigate this, as it shouldn't happen. — 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 rpfm_ui/src/pack_tree/mod.rs:1630 — // TODO: Investigate this, as it shouldn't happen. — 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 rpfm_ui/src/pack_tree/mod.rs:1690 — // TODO: Investigate this, as it shouldn't happen. — 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 rpfm_ui/src/pack_tree/mod.rs:1731 — // TODO: This may be slow on big moves. Fix it with a hashmap. — 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 rpfm_ui/src/global_search_ui/mod.rs:1102 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rpfm_ui/src/global_search_ui/mod.rs:1112 — // TODO: populate this with more types when the ui has them. — 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.
  • + 21 more in this group — see findings.md.
X25 · Inert configuration knob · Configuration option is read nowhere · ×40
  • Configuration option is read nowhere rpfm_extensions/src/dependencies/mod.rs:315 — `TableReferences.referenced_table_is_ak_only` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/dependencies/mod.rs:322 — `TableReferences.referenced_column_is_localised` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/diagnostics/mod.rs:187 — `Diagnostics.folders_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/diagnostics/mod.rs:190 — `Diagnostics.files_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/diagnostics/mod.rs:195 — `Diagnostics.fields_ignored` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:90 — `LuaTestOptions.faction_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:106 — `LuaTestReport.boot_errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:118 — `LuaSave.errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:138 — `LuaTestResult.passed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:142 — `LuaTestResult.errors` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:146 — `LuaTestResult.unmocked_calls` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/lua/harness/mod.rs:149 — `LuaTestResult.log` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/merge/mod.rs:53 — `MergeOptions.delta_merge` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/search/mod.rs:253 — `GlobalSearch.game_key` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:52 — `SettlementLayout.sprawl` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:93 — `SlotLayout.walls` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:98 — `SlotLayout.touching_slots` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:110 — `SprawlCell.in_footprint` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:113 — `SprawlCell.in_zone` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/settlements.rs:116 — `SprawlCell.zone_slots` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/trade.rs:74 — `NetworkSpline.speed_tables` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/trade.rs:77 — `NetworkSpline.lengths` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/startpos/trade.rs:80 — `NetworkSpline.total_length` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_extensions/src/translator/mod.rs:179 — `PackTranslation.glossary` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere rpfm_ipc/src/api/files.rs:354 — `FilesExtracted.extracted` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • + 15 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui_common/src/locale.rs:99 — `FluentResource::try_new(String::new())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `initialize_empty` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui_common/src/locale.rs:101 — `bundle.add_resource(resource)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `initialize_empty` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui_common/src/locale.rs:109 — `file.file_stem()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `get_available_locales` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui_common/src/utils/mod.rs:73 — `Ref::from_raw(ptr.load(Ordering::SeqCst))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `ref_from_atomic` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui_common/src/utils/mod.rs:77 — `Ref::from_raw(ptr.load(Ordering::SeqCst))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `ref_from_atomic_ref` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:43 — `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:44 — `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:47 — `stdout().write_all(error.to_string().as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:48 — `stdout().write_all(b"ERROR: You either don't have nuget installed, it's not in the path, or there was an error while executing it. Download it from here (https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) and drop it in the root of the repo to continue.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:63 — `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:64 — `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:76 — `copy(renderer_path.to_owned()+"x64/Release/ImportExport.lib","./../3rdparty/builds/ImportExport.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:77 — `copy(renderer_path.to_owned()+"x64/Release/QtRenderingWidget.lib","./../3rdparty/builds/QtRenderingWidget.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:78 — `copy(renderer_path.to_owned()+"x64/Release/Rldx.lib","./../3rdparty/builds/Rldx.lib")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:83 — `std::fs::remove_dir_all(&assets_path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:87 — `fs_extra::dir::copy(renderer_path.to_owned()+"Rldx/Rldx/RenderResources","./../",&copy_options)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:88 — `std::fs::rename("./../RenderResources",assets_path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:91 — `stdout().write_all(error.to_string().as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:92 — `stdout().write_all(b"ERROR: You either don't have msbuild installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:101 — `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:102 — `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:115 — `stdout().write_all(error.to_string().as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:116 — `stdout().write_all(b"ERROR: You either don't have nmake installed, it's not in the path, or there was an error while executing it. Fix that before continuing.")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:137 — `stdout().write_all(&output.stdout)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded rpfm_ui/build.rs:138 — `stderr().write_all(&output.stderr)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×38
  • FileTooLong: app_ui/mod.rs rpfm_ui/src/app_ui/mod.rs — FileTooLong — 2841 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: AppUI (2 blocks, 195-4617). The bar is 500 significant lines; this is 2341 over it, 5.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: table/mod.rs rpfm_ui/src/views/table/mod.rs — FileTooLong — 2552 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: TableView (2 blocks, 209-4155). The bar is 500 significant lines; this is 2052 over it, 5.10× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: dependencies/mod.rs rpfm_extensions/src/dependencies/mod.rs — FileTooLong — 1998 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Dependencies (2 blocks, 201-3799). The bar is 500 significant lines; this is 1498 over it, 4.00× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: packfile_contents_ui/slots.rs rpfm_ui/src/packfile_contents_ui/slots.rs — FileTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: PackFileContentsSlots (2 blocks, 88-2622). The bar is 500 significant lines; this is 1182 over it, 3.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: diagnostics_ui/mod.rs rpfm_ui/src/diagnostics_ui/mod.rs — FileTooLong — 1617 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: DiagnosticsUI (2 blocks, 123-2342). The bar is 500 significant lines; this is 1117 over it, 3.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: global_search_ui/mod.rs rpfm_ui/src/global_search_ui/mod.rs — FileTooLong — 1609 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: GlobalSearchUI (2 blocks, 175-2386). The bar is 500 significant lines; this is 1109 over it, 3.22× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/server_mcp.rs rpfm_server/src/server_mcp.rs — FileTooLong — 1418 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: McpServer (5 blocks, 262-2128). The bar is 500 significant lines; this is 918 over it, 2.84× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: files/mod.rs rpfm_lib/src/files/mod.rs — FileTooLong — 1390 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 890 over it, 2.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: games/supported_games.rs rpfm_lib/src/games/supported_games.rs — FileTooLong — 1241 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: SupportedGames (3 blocks, 214-3974). The bar is 500 significant lines; this is 741 over it, 2.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: app_ui/slots.rs rpfm_ui/src/app_ui/slots.rs — FileTooLong — 1231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: AppUISlots (2 blocks, 107-2021). The bar is 500 significant lines; this is 731 over it, 2.46× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: translator/mod.rs rpfm_ui/src/tools/translator/mod.rs — FileTooLong — 1217 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: ToolTranslator (2 blocks, 200-1956). The bar is 500 significant lines; this is 717 over it, 2.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/ceo_builder.rs rpfm_server/src/ceo_builder.rs — FileTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 699 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pack_tree/mod.rs rpfm_ui/src/pack_tree/mod.rs — FileTooLong — 1165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: QPtr (273-1860). The bar is 500 significant lines; this is 665 over it, 2.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: decoder/mod.rs rpfm_ui/src/packedfile_views/decoder/mod.rs — FileTooLong — 1134 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: PackedFileDecoderView (2 blocks, 96-1640). The bar is 500 significant lines; this is 634 over it, 2.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: group_formations/mod.rs rpfm_ui/src/packedfile_views/group_formations/mod.rs — FileTooLong — 984 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: GroupFormationsView (2 blocks, 157-1221). The bar is 500 significant lines; this is 484 over it, 1.97× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: table/utils.rs rpfm_ui/src/views/table/utils.rs — FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 408 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: settings_ui/mod.rs rpfm_ui/src/settings_ui/mod.rs — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: SettingsUI (2 blocks, 127-1160). The bar is 500 significant lines; this is 379 over it, 1.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: schema/mod.rs rpfm_lib/src/schema/mod.rs — FileTooLong — 860 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 360 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pack/mod.rs rpfm_lib/src/files/pack/mod.rs — FileTooLong — 834 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: Pack (5 blocks, 240-1559). The bar is 500 significant lines; this is 334 over it, 1.67× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: portrait_settings/mod.rs rpfm_ui/src/packedfile_views/portrait_settings/mod.rs — FileTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: PortraitSettingsView (2 blocks, 90-1111). The bar is 500 significant lines; this is 286 over it, 1.57× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: state/files.rs rpfm_server/src/state/files.rs — FileTooLong — 760 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: SessionState (2 blocks, 83-1229). The bar is 500 significant lines; this is 260 over it, 1.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: table/mod.rs rpfm_lib/src/files/table/mod.rs — FileTooLong — 734 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 234 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: faction_painter/mod.rs rpfm_ui/src/tools/faction_painter/mod.rs — FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: ToolFactionPainter (2 blocks, 95-1137). The bar is 500 significant lines; this is 210 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: search/mod.rs rpfm_extensions/src/search/mod.rs — FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: esf_detailed_view/mod.rs rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs — FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: ESFDetailedView (2 blocks, 60-1026). The bar is 500 significant lines; this is 165 over it, 1.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • + 13 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Unfinished branch · ×36
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:629 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:650 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:670 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:690 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:712 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:732 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:766 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:787 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_extensions/src/search/mod.rs:807 — `replace` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/cs2_collision/mod.rs:323 — `encode` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/cs2_parsed/mod.rs:845 — `encode` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/db/mod.rs:397 — `table_name_without_tables` does real work, but one of its branches is `panic!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/esf/utils.rs:679 — `save_node` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/mod.rs:3195 — `from` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/portrait_settings/mod.rs:206 — `encode` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:80 — `read` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:82 — `read` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:112 — `read` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:134 — `write` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:136 — `write` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/sound_bank/common/mod.rs:166 — `write` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/table/mod.rs:1433 — `decode_field_postprocess` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/table/mod.rs:1449 — `decode_field_postprocess` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/table/mod.rs:1467 — `decode_field_postprocess` does real work, but one of its branches is `unimplemented!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function rpfm_lib/src/files/uic/mod.rs:268 — `decode` does real work, but one of its branches is `todo!` — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×34
  • Duplicated block (8 lines × 2) rpfm_extensions/src/dependencies/mod.rs:681 — rpfm_extensions/src/dependencies/mod.rs:681-688 | rpfm_extensions/src/dependencies/mod.rs:692-699 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:681` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) rpfm_extensions/src/search/atlas.rs:107 — rpfm_extensions/src/search/atlas.rs:107-114 | rpfm_extensions/src/search/portrait_settings.rs:211-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/search/atlas.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_lib/src/files/sound_bank_database/mod.rs:497 — rpfm_lib/src/files/sound_bank_database/mod.rs:497-504 | rpfm_lib/src/files/sound_events/mod.rs:338-345 — 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 `rpfm_lib/src/files/sound_bank_database/mod.rs:497` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/sound_events/mod.rs:347` calls `read_emp` and `rpfm_lib/src/files/sound_bank_database/mod.rs:507` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) rpfm_lib/src/integrations/assembly_kit/mod.rs:426 — rpfm_lib/src/integrations/assembly_kit/mod.rs:426-433 | rpfm_lib/src/integrations/assembly_kit/mod.rs:480-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/integrations/assembly_kit/mod.rs:426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_lib/src/integrations/git.rs:223 — rpfm_lib/src/integrations/git.rs:223-230 | rpfm_lib/src/integrations/git.rs:320-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/integrations/git.rs:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/global_search_ui/mod.rs:755 — rpfm_ui/src/global_search_ui/mod.rs:755-762 | rpfm_ui/src/global_search_ui/mod.rs:813-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:198 — rpfm_ui/src/tools/faction_painter/mod.rs:198-205 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:171-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/mod.rs:785 — rpfm_ui/src/tools/mod.rs:785-792 | rpfm_ui/src/tools/mod.rs:1092-1099 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:785` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:786 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:786-793 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:867-874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:786` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:865` calls `set_current_text` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:784` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/unit_editor/variant_unit_editor/slots.rs:82 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/slots.rs:82-89 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/slots.rs:103-110 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/unit_editor/variant_unit_editor/slots.rs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/filter/slots.rs:85 — rpfm_ui/src/views/table/filter/slots.rs:85-92 | rpfm_ui/src/views/table/filter/slots.rs:123-130 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/filter/slots.rs:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/mod.rs:3542 — rpfm_ui/src/views/table/mod.rs:3542-3549 | rpfm_ui/src/views/table/mod.rs:3728-3735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/mod.rs:3776 — rpfm_ui/src/views/table/mod.rs:3776-3783 | rpfm_ui/src/views/table/mod.rs:3902-3909 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/mod.rs:3776` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:960 — rpfm_ui/src/tools/faction_painter/mod.rs:960-967 | rpfm_ui/src/tools/faction_painter/mod.rs:1040-1047 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:960` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:971 — rpfm_ui/src/tools/faction_painter/mod.rs:971-978 | rpfm_ui/src/tools/faction_painter/mod.rs:1106-1113 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:971` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2542 — rpfm_extensions/src/dependencies/mod.rs:2542-2549 | rpfm_extensions/src/dependencies/mod.rs:2555-2562 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/packedfile_views/decoder/mod.rs:1344 — rpfm_ui/src/packedfile_views/decoder/mod.rs:1344-1351 | rpfm_ui/src/packedfile_views/decoder/mod.rs:1600-1607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/tools/mod.rs:408 — rpfm_ui/src/tools/mod.rs:408-415 | rpfm_ui/src/tools/mod.rs:442-449 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:525 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:525-532 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:605-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:625 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:625-632 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:645-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:708 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:708-715 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:728-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/mod.rs:1621 — rpfm_ui/src/views/table/mod.rs:1621-1628 | rpfm_ui/src/views/table/mod.rs:3456-3463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/views/table/mod.rs:3453` calls `packfile_contents_tree_view`, `update_treeview`, `UpdateTooltip` and `rpfm_ui/src/views/table/mod.rs:1617` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/mod.rs:2507 — rpfm_ui/src/views/table/mod.rs:2507-2514 | rpfm_ui/src/views/table/mod.rs:2516-2523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) rpfm_ui/src/views/table/search/mod.rs:489 — rpfm_ui/src/views/table/search/mod.rs:489-496 | rpfm_ui/src/views/table/search/mod.rs:561-568 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/search/mod.rs:489` 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 (8 lines × 2) rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:52 — rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:52-59 | rpfm_lib/src/files/bmd/prop_list/mod.rs:54-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.
  • + 9 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×29
  • Hotspot: rpfm_ui/src/packfile_contents_ui/slots.rs rpfm_ui/src/packfile_contents_ui/slots.rs:181 — rpfm_ui/src/packfile_contents_ui/slots.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 266 in PackFileContentsSlots::new at line 181. 1 of those changes was a fix/bug commit, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/packfile_contents_ui/slots.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/app_ui/mod.rs rpfm_ui/src/app_ui/mod.rs:2019 — rpfm_ui/src/app_ui/mod.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in AppUI::open_packedfile at line 2019. 5 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/app_ui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/app_ui/slots.rs rpfm_ui/src/app_ui/slots.rs:475 — rpfm_ui/src/app_ui/slots.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 146 in AppUISlots::new at line 475. 2 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/app_ui/slots.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/views/table/slots.rs rpfm_ui/src/views/table/slots.rs:122 — rpfm_ui/src/views/table/slots.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in TableViewSlots::new at line 122. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/views/table/slots.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_extensions/src/dependencies/mod.rs rpfm_extensions/src/dependencies/mod.rs:3376 — rpfm_extensions/src/dependencies/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in Dependencies::build_starpos_post at line 3376. 7 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_extensions/src/dependencies/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/tools/translator/mod.rs rpfm_ui/src/tools/translator/mod.rs:294 — rpfm_ui/src/tools/translator/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in ToolTranslator::new at line 294. 1 of those changes was a fix/bug commit, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/tools/translator/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_lib/src/files/esf/utils.rs rpfm_lib/src/files/esf/utils.rs:675 — rpfm_lib/src/files/esf/utils.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in ESF::save_node at line 675. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_lib/src/files/esf/utils.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/views/table/mod.rs rpfm_ui/src/views/table/mod.rs:398 — rpfm_ui/src/views/table/mod.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in TableView::new_view at line 398. 4 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/views/table/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/diagnostics_ui/mod.rs rpfm_ui/src/diagnostics_ui/mod.rs:1208 — rpfm_ui/src/diagnostics_ui/mod.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in DiagnosticsUI::open_match at line 1208. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/diagnostics_ui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/packedfile_views/mod.rs rpfm_ui/src/packedfile_views/mod.rs:502 — rpfm_ui/src/packedfile_views/mod.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in FileView::reload at line 502. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/packedfile_views/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_server/src/state/files.rs rpfm_server/src/state/files.rs:789 — rpfm_server/src/state/files.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in SessionState::import_dependencies at line 789. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_server/src/state/files.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/communications/mod.rs rpfm_ui/src/communications/mod.rs:385 — rpfm_ui/src/communications/mod.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in rpfm_ui::communications::websocket_loop at line 385. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/communications/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_extensions/src/startpos/world/mod.rs rpfm_extensions/src/startpos/world/mod.rs:267 — rpfm_extensions/src/startpos/world/mod.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in CampaignIndex::new at line 267. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_extensions/src/startpos/world/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ipc/src/settings.rs rpfm_ipc/src/settings.rs:152 — rpfm_ipc/src/settings.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Settings::init at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ipc/src/settings.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_extensions/src/diagnostics/mod.rs rpfm_extensions/src/diagnostics/mod.rs:314 — rpfm_extensions/src/diagnostics/mod.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in Diagnostics::check at line 314. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_extensions/src/diagnostics/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/global_search_ui/mod.rs rpfm_ui/src/global_search_ui/mod.rs:1193 — rpfm_ui/src/global_search_ui/mod.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in GlobalSearchUI::load_anim_fragment_battle_matches_to_ui at line 1193. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/global_search_ui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_server/src/server_websocket.rs rpfm_server/src/server_websocket.rs:108 — rpfm_server/src/server_websocket.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in rpfm_server::server_websocket::handle_socket at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_server/src/server_websocket.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_extensions/src/translator/mod.rs rpfm_extensions/src/translator/mod.rs:277 — rpfm_extensions/src/translator/mod.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in PackTranslation::new at line 277. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_extensions/src/translator/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/ui/mod.rs rpfm_ui/src/ui/mod.rs:215 — rpfm_ui/src/ui/mod.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in UI::finish_online_init at line 215. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/ui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_lib/src/files/db/mod.rs rpfm_lib/src/files/db/mod.rs:485 — rpfm_lib/src/files/db/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in DB::cascade_edition at line 485. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_lib/src/files/db/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/settings_ui/mod.rs rpfm_ui/src/settings_ui/mod.rs:222 — rpfm_ui/src/settings_ui/mod.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SettingsUI::new_with_parent at line 222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/settings_ui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_extensions/src/startpos/cai/managers.rs rpfm_extensions/src/startpos/cai/managers.rs:394 — rpfm_extensions/src/startpos/cai/managers.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ManagerContext::write_desire at line 394. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_extensions/src/startpos/cai/managers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_lib/src/files/esf/caab.rs rpfm_lib/src/files/esf/caab.rs:89 — rpfm_lib/src/files/esf/caab.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ESF::read_caab at line 89. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_lib/src/files/esf/caab.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_ui/src/packedfile_views/group_formations/slots.rs rpfm_ui/src/packedfile_views/group_formations/slots.rs:111 — rpfm_ui/src/packedfile_views/group_formations/slots.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in GroupFormationsSlots::new at line 111. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_ui/src/packedfile_views/group_formations/slots.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rpfm_lib/src/files/esf/cbab.rs rpfm_lib/src/files/esf/cbab.rs:211 — rpfm_lib/src/files/esf/cbab.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ESF::save_cbab at line 211. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:26:56 +01:00' --until='2026-10-28 19:26:56 +01:00' --full-history --no-merges -- rpfm_lib/src/files/esf/cbab.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×28
  • Duplicated block (7 lines × 2) rpfm_extensions/src/dependencies/mod.rs:527 — rpfm_extensions/src/dependencies/mod.rs:527-533 | rpfm_extensions/src/dependencies/mod.rs:887-893 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/dependencies/mod.rs:968 — rpfm_extensions/src/dependencies/mod.rs:968-974 | rpfm_extensions/src/dependencies/mod.rs:980-986 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:968` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1313 — rpfm_extensions/src/dependencies/mod.rs:1313-1319 | rpfm_extensions/src/dependencies/mod.rs:1335-1341 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1313` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/gltf/mod.rs:139 — rpfm_extensions/src/gltf/mod.rs:139-145 | rpfm_extensions/src/gltf/mod.rs:148-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:65 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:65-71 | rpfm_lib/src/files/bmd/common/flags/mod.rs:149-155 — 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 `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_lib/src/files/esf/utils.rs:1011 — rpfm_lib/src/files/esf/utils.rs:1011-1017 | rpfm_lib/src/files/esf/utils.rs:1021-1027 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/esf/utils.rs:1011` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_lib/src/files/mod.rs:2525 — rpfm_lib/src/files/mod.rs:2525-2531 | rpfm_lib/src/files/mod.rs:3014-3020 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/mod.rs:2525` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_lib/src/games/mod.rs:1468 — rpfm_lib/src/games/mod.rs:1468-1474 | rpfm_lib/src/games/mod.rs:1522-1528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) rpfm_lib/src/integrations/assembly_kit/mod.rs:530 — rpfm_lib/src/integrations/assembly_kit/mod.rs:530-536 | rpfm_lib/src/integrations/assembly_kit/mod.rs:570-576 — both copies are in the same file, so extract the 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 `rpfm_lib/src/integrations/assembly_kit/mod.rs:530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/app_ui/mod.rs:2556 — rpfm_ui/src/app_ui/mod.rs:2556-2562 | rpfm_ui/src/app_ui/mod.rs:2575-2581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rpfm_ui/src/diagnostics_ui/mod.rs:1946 — rpfm_ui/src/diagnostics_ui/mod.rs:1946-1952 | rpfm_ui/src/diagnostics_ui/mod.rs:1983-1990 — both copies are in the same file, so extract the 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 `rpfm_ui/src/diagnostics_ui/mod.rs:1946` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/global_search_ui/mod.rs:1049 — rpfm_ui/src/global_search_ui/mod.rs:1049-1055 | rpfm_ui/src/global_search_ui/mod.rs:1150-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rpfm_ui/src/packedfile_views/mod.rs:614 — rpfm_ui/src/packedfile_views/mod.rs:614-620 | rpfm_ui/src/packedfile_views/mod.rs:665-671 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/mod.rs:614` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:312 — rpfm_ui/src/tools/faction_painter/mod.rs:312-318 | rpfm_ui/src/tools/faction_painter/mod.rs:321-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/tools/mod.rs:706 — rpfm_ui/src/tools/mod.rs:706-712 | rpfm_ui/src/tools/mod.rs:825-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/mod.rs:706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/tools/unit_editor/mod.rs:683 — rpfm_ui/src/tools/unit_editor/mod.rs:683-689 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:654-660 — before extracting anything, compare `rpfm_ui/src/tools/unit_editor/mod.rs` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 261 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/unit_editor/mod.rs:683` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/views/table/mod.rs:1179 — rpfm_ui/src/views/table/mod.rs:1179-1185 | rpfm_ui/src/views/table/mod.rs:1245-1251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/dependencies/mod.rs:3308 — rpfm_extensions/src/dependencies/mod.rs:3308-3314 | rpfm_extensions/src/dependencies/mod.rs:3337-3343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_extensions/src/dependencies/mod.rs:3316` calls `arg` and `rpfm_extensions/src/dependencies/mod.rs:3345` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) rpfm_ui/src/diagnostics_ui/mod.rs:1292 — rpfm_ui/src/diagnostics_ui/mod.rs:1292-1298 | rpfm_ui/src/diagnostics_ui/mod.rs:1320-1326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rpfm_ui/src/views/table/utils.rs:650 — rpfm_ui/src/views/table/utils.rs:650-656 | rpfm_ui/src/views/table/utils.rs:672-678 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/utils.rs:650` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1873 — rpfm_extensions/src/dependencies/mod.rs:1873-1879 | rpfm_extensions/src/dependencies/mod.rs:1896-1902 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1873` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_extensions/src/startpos/layout.rs:1271 — rpfm_extensions/src/startpos/layout.rs:1271-1277 | rpfm_extensions/src/startpos/layout.rs:1300-1306 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/startpos/layout.rs:1271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui/src/views/table/utils.rs:353 — rpfm_ui/src/views/table/utils.rs:353-359 | rpfm_ui/src/views/table/utils.rs:365-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/utils.rs:353` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_ui_common/src/icons/mod.rs:251 — rpfm_ui_common/src/icons/mod.rs:251-257 | rpfm_ui_common/src/icons/mod.rs:382-388 — both copies are in the same file, so extract the 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 `rpfm_ui_common/src/icons/mod.rs:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:43 — rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:43-49 | rpfm_lib/src/files/bmd/prop_list/mod.rs:45-51 — 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.
  • + 3 more in this group — see findings.md.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×28
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/video/ivf.rs:53 — `num_frames` is read from the bytes being parsed at line 47 (`read_u32`), then used to size a `Vec::with_capacity` at line 53 — and nowhere in its scope is `num_frames` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `num_frames` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/unit_variant/mod.rs:190 — `variants_on_this_category` is read from the bytes being parsed at line 184 (`read_u32`), then used to size a `Vec::with_capacity` at line 190 — and nowhere in its scope is `variants_on_this_category` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `variants_on_this_category` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v6.rs:44 — `mesh_count` is read from the bytes being parsed at line 43 (`read_u32`), then used to size a `Vec::with_capacity` at line 44 — and nowhere in its scope is `mesh_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `mesh_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v6.rs:94 — `vertex_count` is read from the bytes being parsed at line 76 (`read_u32`), then used to size a `Vec::with_capacity` at line 94 — and nowhere in its scope is `vertex_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `vertex_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v6.rs:95 — `index_count` is read from the bytes being parsed at line 78 (`read_u32`), then used to size a `Vec::with_capacity` at line 95 — and nowhere in its scope is `index_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `index_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v7.rs:37 — `mesh_count` is read from the bytes being parsed at line 36 (`read_u32`), then used to size a `Vec::with_capacity` at line 37 — and nowhere in its scope is `mesh_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `mesh_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v7.rs:75 — `vertex_count` is read from the bytes being parsed at line 63 (`read_u32`), then used to size a `Vec::with_capacity` at line 75 — and nowhere in its scope is `vertex_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `vertex_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v7.rs:76 — `index_count` is read from the bytes being parsed at line 65 (`read_u32`), then used to size a `Vec::with_capacity` at line 76 — and nowhere in its scope is `index_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `index_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v8.rs:37 — `mesh_count` is read from the bytes being parsed at line 36 (`read_u32`), then used to size a `Vec::with_capacity` at line 37 — and nowhere in its scope is `mesh_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `mesh_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v8.rs:75 — `vertex_count` is read from the bytes being parsed at line 63 (`read_u32`), then used to size a `Vec::with_capacity` at line 75 — and nowhere in its scope is `vertex_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `vertex_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/versions/v8.rs:76 — `index_count` is read from the bytes being parsed at line 65 (`read_u32`), then used to size a `Vec::with_capacity` at line 76 — and nowhere in its scope is `index_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `index_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/cloth.rs:23 — `uk_7_count` is read from the bytes being parsed at line 22 (`read_u32`), then used to size a `Vec::with_capacity` at line 23 — and nowhere in its scope is `uk_7_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_7_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/cloth.rs:26 — `uk_8_count` is read from the bytes being parsed at line 25 (`read_u32`), then used to size a `Vec::with_capacity` at line 26 — and nowhere in its scope is `uk_8_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_8_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/cloth.rs:29 — `uk_9_count` is read from the bytes being parsed at line 28 (`read_u32`), then used to size a `Vec::with_capacity` at line 29 — and nowhere in its scope is `uk_9_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `uk_9_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:52 — `attachment_points_count` is read from the bytes being parsed at line 51 (`read_u32`), then used to size a `Vec::with_capacity` at line 52 — and nowhere in its scope is `attachment_points_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `attachment_points_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:55 — `texture_count` is read from the bytes being parsed at line 54 (`read_u32`), then used to size a `Vec::with_capacity` at line 55 — and nowhere in its scope is `texture_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `texture_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:58 — `param_string_count` is read from the bytes being parsed at line 57 (`read_u32`), then used to size a `Vec::with_capacity` at line 58 — and nowhere in its scope is `param_string_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_string_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:61 — `param_f32_count` is read from the bytes being parsed at line 60 (`read_u32`), then used to size a `Vec::with_capacity` at line 61 — and nowhere in its scope is `param_f32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_f32_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:64 — `param_i32_count` is read from the bytes being parsed at line 63 (`read_u32`), then used to size a `Vec::with_capacity` at line 64 — and nowhere in its scope is `param_i32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_i32_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/default.rs:67 — `param_vector4df32_count` is read from the bytes being parsed at line 66 (`read_u32`), then used to size a `Vec::with_capacity` at line 67 — and nowhere in its scope is `param_vector4df32_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `param_vector4df32_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/rope.rs:30 — `node_count` is read from the bytes being parsed at line 24 (`read_u32`), then used to size a `Vec::with_capacity` at line 30 — and nowhere in its scope is `node_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `node_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/rigidmodel/materials/weighted_cloth.rs:27 — `bone_count` is read from the bytes being parsed at line 25 (`read_u32`), then used to size a `Vec::with_capacity` at line 27 — and nowhere in its scope is `bone_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `bone_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/fxc/v4.rs:27 — `define_count` is read from the bytes being parsed at line 26 (`read_u32`), then used to size a `Vec::with_capacity` at line 27 — and nowhere in its scope is `define_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `define_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/fxc/v4.rs:37 — `include_count` is read from the bytes being parsed at line 36 (`read_u32`), then used to size a `Vec::with_capacity` at line 37 — and nowhere in its scope is `include_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `include_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded rpfm_lib/src/files/asset_variation_db/v1.rs:42 — `category_count` is read from the bytes being parsed at line 41 (`read_u32`), then used to size a `Vec::with_capacity` at line 42 — and nowhere in its scope is `category_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `category_count` against the bytes actually remaining and a maximum the format allows before allocating.
  • + 3 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×27
  • ClassTooLong: AppUI rpfm_ui/src/app_ui/mod.rs:195 — ClassTooLong — 2675 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 50 methods, 2 blocks, lines 195-4617. The bar is 400 significant lines; this is 2275 over it, 6.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TableView rpfm_ui/src/views/table/mod.rs:209 — ClassTooLong — 2352 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 71 methods, 2 blocks, lines 209-4155. The bar is 400 significant lines; this is 1952 over it, 5.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Dependencies rpfm_extensions/src/dependencies/mod.rs:201 — ClassTooLong — 1944 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 52 methods, 2 blocks, lines 201-3799. The bar is 400 significant lines; this is 1544 over it, 4.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PackFileContentsSlots rpfm_ui/src/packfile_contents_ui/slots.rs:88 — ClassTooLong — 1600 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 88-2622. The bar is 400 significant lines; this is 1200 over it, 4.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiagnosticsUI rpfm_ui/src/diagnostics_ui/mod.rs:123 — ClassTooLong — 1537 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 123-2342. The bar is 400 significant lines; this is 1137 over it, 3.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GlobalSearchUI rpfm_ui/src/global_search_ui/mod.rs:175 — ClassTooLong — 1482 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 175-2386. The bar is 400 significant lines; this is 1082 over it, 3.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: McpServer rpfm_server/src/server_mcp.rs:262 — ClassTooLong — 1285 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 110 methods, 5 blocks, lines 262-2128. The bar is 400 significant lines; this is 885 over it, 3.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SupportedGames rpfm_lib/src/games/supported_games.rs:214 — ClassTooLong — 1207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 3 blocks, lines 214-3974. The bar is 400 significant lines; this is 807 over it, 3.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ToolTranslator rpfm_ui/src/tools/translator/mod.rs:200 — ClassTooLong — 1085 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 2 blocks, lines 200-1956. The bar is 400 significant lines; this is 685 over it, 2.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PackedFileDecoderView rpfm_ui/src/packedfile_views/decoder/mod.rs:96 — ClassTooLong — 1029 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 96-1640. The bar is 400 significant lines; this is 629 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppUISlots rpfm_ui/src/app_ui/slots.rs:107 — ClassTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 107-2021. The bar is 400 significant lines; this is 620 over it, 2.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PortraitSettingsView rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:90 — ClassTooLong — 729 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 2 blocks, lines 90-1111. The bar is 400 significant lines; this is 329 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GroupFormationsView rpfm_ui/src/packedfile_views/group_formations/mod.rs:157 — ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 2 blocks, lines 157-1221. The bar is 400 significant lines; this is 300 over it, 1.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ToolFactionPainter rpfm_ui/src/tools/faction_painter/mod.rs:95 — ClassTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 95-1137. The bar is 400 significant lines; this is 258 over it, 1.65× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SettingsUI rpfm_ui/src/settings_ui/mod.rs:127 — ClassTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 2 blocks, lines 127-1160. The bar is 400 significant lines; this is 238 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DB rpfm_lib/src/files/db/mod.rs:145 — ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 5 blocks, lines 145-1380. The bar is 400 significant lines; this is 235 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Pack rpfm_lib/src/files/pack/mod.rs:240 — ClassTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 5 blocks, lines 240-1559. The bar is 400 significant lines; this is 234 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TableViewSlots rpfm_ui/src/views/table/slots.rs:65 — ClassTooLong — 623 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 65-1058. The bar is 400 significant lines; this is 223 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ESFDetailedView rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:60 — ClassTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 2 blocks, lines 60-1026. The bar is 400 significant lines; this is 195 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Tool rpfm_ui/src/tools/mod.rs:139 — ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 2 blocks, lines 139-1208. The bar is 400 significant lines; this is 180 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RFile rpfm_lib/src/files/mod.rs:296 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 296-2938. The bar is 400 significant lines; this is 142 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PackFileContentsUI rpfm_ui/src/packfile_contents_ui/mod.rs:86 — ClassTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 86-903. The bar is 400 significant lines; this is 127 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GameInfo rpfm_lib/src/games/mod.rs:219 — ClassTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 2 blocks, lines 219-1768. The bar is 400 significant lines; this is 106 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ToolUnitEditor rpfm_ui/src/tools/unit_editor/mod.rs:140 — ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 140-1032. The bar is 400 significant lines; this is 87 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SubToolVariantUnitEditor rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:91 — ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 91-958. The bar is 400 significant lines; this is 87 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 2 more in this group — see findings.md.
D2 · Cognitive Complexity · Dependencies · ×24
  • Dependencies::generate_automatic_patches (cognitive 266) rpfm_extensions/src/dependencies/mod.rs:2584 — Dependencies::generate_automatic_patches has cognitive complexity 266 (threshold 15). Drivers by points: if/else 66 (172 pts), boolean chains 69, match/switch 5 (21 pts), loops 3 (4 pts) (nesting depth added 123). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::db_reference_data_generic (cognitive 211) rpfm_extensions/src/dependencies/mod.rs:1740 — Dependencies::db_reference_data_generic has cognitive complexity 211 (threshold 15). Drivers by points: if/else 29 (148 pts), loops 7 (40 pts), match/switch 4 (23 pts) (nesting depth added 171). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::bruteforce_loc_key_order (cognitive 140) rpfm_extensions/src/dependencies/mod.rs:2334 — Dependencies::bruteforce_loc_key_order has cognitive complexity 140 (threshold 15). Drivers by points: if/else 33 (88 pts), loops 11 (35 pts), match/switch 5 (13 pts), boolean chains 4 (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::build_starpos_post (cognitive 104) rpfm_extensions/src/dependencies/mod.rs:3376 — Dependencies::build_starpos_post has cognitive complexity 104 (threshold 15). Drivers by points: if/else 42 (78 pts), loops 6 (12 pts), boolean chains 7, match/switch 4 (7 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::build_starpos_pre (cognitive 91) rpfm_extensions/src/dependencies/mod.rs:3074 — Dependencies::build_starpos_pre has cognitive complexity 91 (threshold 15). Drivers by points: if/else 36 (71 pts), match/switch 5 (13 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::loc_key_source (cognitive 54) rpfm_extensions/src/dependencies/mod.rs:2015 — Dependencies::loc_key_source has cognitive complexity 54 (threshold 15). Drivers by points: if/else 8 (35 pts), loops 4 (19 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::db_and_loc_data (cognitive 52) rpfm_extensions/src/dependencies/mod.rs:1498 — Dependencies::db_and_loc_data has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 6 (18 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::generate_references (cognitive 48) rpfm_extensions/src/dependencies/mod.rs:581 — Dependencies::generate_references has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::db_reference_data (cognitive 41) rpfm_extensions/src/dependencies/mod.rs:1577 — Dependencies::db_reference_data has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (33 pts), match/switch 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::db_data_datacored (cognitive 39) rpfm_extensions/src/dependencies/mod.rs:1437 — Dependencies::db_data_datacored has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (15 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::add_recursive_lookups (cognitive 38) rpfm_extensions/src/dependencies/mod.rs:3742 — Dependencies::add_recursive_lookups has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 1 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::db_reference_data_generic_lookup (cognitive 32) rpfm_extensions/src/dependencies/mod.rs:1953 — Dependencies::db_reference_data_generic_lookup has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::files_by_path (cognitive 30) rpfm_extensions/src/dependencies/mod.rs:1214 — Dependencies::files_by_path has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::db_data (cognitive 29) rpfm_extensions/src/dependencies/mod.rs:1388 — Dependencies::db_data has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (9 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::add_recursive_lookups_to_definition (cognitive 26) rpfm_extensions/src/dependencies/mod.rs:3695 — Dependencies::add_recursive_lookups_to_definition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (9 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::file (cognitive 25) rpfm_extensions/src/dependencies/mod.rs:1105 — Dependencies::file has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (25 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::load_parent_pack (cognitive 24) rpfm_extensions/src/dependencies/mod.rs:1006 — Dependencies::load_parent_pack has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (24 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Dependencies::load_loose_files (cognitive 22) rpfm_extensions/src/dependencies/mod.rs:792 — Dependencies::load_loose_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 4 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::db_values_from_table_name_and_column_name_for_value (cognitive 20) rpfm_extensions/src/dependencies/mod.rs:2246 — Dependencies::db_values_from_table_name_and_column_name_for_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::files_mut_by_paths (cognitive 19) rpfm_extensions/src/dependencies/mod.rs:1180 — Dependencies::files_mut_by_paths has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::generate_dependencies_cache (cognitive 17) rpfm_extensions/src/dependencies/mod.rs:407 — Dependencies::generate_dependencies_cache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::loc_data (cognitive 17) rpfm_extensions/src/dependencies/mod.rs:1346 — Dependencies::loc_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::load_parent_files (cognitive 16) rpfm_extensions/src/dependencies/mod.rs:901 — Dependencies::load_parent_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Dependencies::file_exists (cognitive 16) rpfm_extensions/src/dependencies/mod.rs:2088 — Dependencies::file_exists has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×24
  • Duplicated block (6 lines × 2) rpfm_extensions/src/startpos/world/mod.rs:468 — rpfm_extensions/src/startpos/world/mod.rs:468-473 | rpfm_extensions/src/startpos/world/mod.rs:494-499 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/startpos/world/mod.rs:468` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:42 — rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:42-47 | rpfm_lib/src/files/bmd/zones_template_list/mod.rs:43-48 — 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 `rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:71 — rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:71-76 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/mod.rs:61-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_lib/src/files/sound_bank_database/mod.rs:520 — rpfm_lib/src/files/sound_bank_database/mod.rs:520-525 | rpfm_lib/src/files/sound_events/mod.rs:361-366 — 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 `rpfm_lib/src/files/sound_bank_database/mod.rs:520` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/sound_events/mod.rs:368` calls `write_emp` and `rpfm_lib/src/files/sound_bank_database/mod.rs:528` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) rpfm_lib/src/files/table/mod.rs:676 — rpfm_lib/src/files/table/mod.rs:676-681 | rpfm_lib/src/integrations/assembly_kit/table_data.rs:473-478 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/table/mod.rs:682` calls `ColourRGB`, `to_owned`, `StringU8` and `rpfm_lib/src/integrations/assembly_kit/table_data.rs:479` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) rpfm_ui/src/global_search_ui/mod.rs:684 — rpfm_ui/src/global_search_ui/mod.rs:684-689 | rpfm_ui/src/global_search_ui/mod.rs:738-743 — both copies are in the same file, so extract the 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 `rpfm_ui/src/global_search_ui/mod.rs:684` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:208 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:208-213 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:385-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:383 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:383-388 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:203-208 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:389` calls `new_1a`, `as_ptr` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs:209` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:455 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:455-460 | rpfm_ui/src/tools/translator/mod.rs:990-995 — 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 `rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_ui/src/views/table/utils.rs:637 — rpfm_ui/src/views/table/utils.rs:637-642 | rpfm_ui/src/views/table/utils.rs:659-664 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/utils.rs:637` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_ui/src/welcome_page_ui/mod.rs:127 — rpfm_ui/src/welcome_page_ui/mod.rs:127-132 | rpfm_ui/src/welcome_page_ui/mod.rs:159-164 — both copies are in the same file, so extract the 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 `rpfm_ui/src/welcome_page_ui/mod.rs: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 (6 lines × 2) rpfm_ui/src/settings_ui/mod.rs:1233 — rpfm_ui/src/settings_ui/mod.rs:1233-1238 | rpfm_ui/src/settings_ui/mod.rs:1309-1314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_extensions/src/startpos/world/writer/sight.rs:290 — rpfm_extensions/src/startpos/world/writer/sight.rs:290-295 | rpfm_extensions/src/startpos/writer/mod.rs:205-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) rpfm_ui/src/app_ui/mod.rs:3082 — rpfm_ui/src/app_ui/mod.rs:3082-3088 | rpfm_ui/src/app_ui/mod.rs:3309-3314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_telemetry/src/logger.rs:487 — rpfm_telemetry/src/logger.rs:487-492 | rpfm_telemetry/src/logger.rs:508-513 — both copies are in the same file, so extract the 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 `rpfm_telemetry/src/logger.rs:487` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_server/src/ceo_builder.rs:823 — rpfm_server/src/ceo_builder.rs:823-828 | rpfm_server/src/ceo_builder.rs:1126-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_server/src/ceo_builder.rs:299 — rpfm_server/src/ceo_builder.rs:299-304 | rpfm_server/src/ceo_builder.rs:1029-1034 — both copies are in the same file, so extract the 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 `rpfm_server/src/ceo_builder.rs:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_lib/src/files/asset_variation_db/mod.rs:390 — rpfm_lib/src/files/asset_variation_db/mod.rs:390-395 | rpfm_lib/src/files/asset_variation_db/mod.rs:501-506 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/asset_variation_db/mod.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rpfm_server/src/ceo_builder.rs:344 — rpfm_server/src/ceo_builder.rs:344-349 | rpfm_server/src/ceo_builder.rs:354-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_ui/src/global_search_ui/mod.rs:492 — rpfm_ui/src/global_search_ui/mod.rs:492-497 | rpfm_ui/src/global_search_ui/mod.rs:515-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.
  • Duplicated block (6 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:697 — rpfm_ui/src/tools/faction_painter/mod.rs:697-702 | rpfm_ui/src/tools/faction_painter/mod.rs:819-824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:704 — rpfm_ui/src/tools/faction_painter/mod.rs:704-709 | rpfm_ui/src/tools/faction_painter/mod.rs:903-908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_ui/src/views/table/mod.rs:2633 — rpfm_ui/src/views/table/mod.rs:2633-2638 | rpfm_ui/src/views/table/mod.rs:2701-2706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rpfm_ui/src/views/table/utils.rs:816 — rpfm_ui/src/views/table/utils.rs:816-821 | rpfm_ui/src/views/table/utils.rs:842-847 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/utils.rs:816` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · TableView · ×23
  • TableView::set_data_on_cells (cognitive 128) rpfm_ui/src/views/table/mod.rs:2960 — TableView::set_data_on_cells has cognitive complexity 128 (threshold 15). Drivers by points: if/else 34 (105 pts), loops 3 (10 pts), match/switch 2 (10 pts), boolean chains 3 (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::go_to_file (cognitive 113) rpfm_ui/src/views/table/mod.rs:3892 — TableView::go_to_file has cognitive complexity 113 (threshold 15). Drivers by points: if/else 28 (104 pts), loops 1 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 82). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::process_edition (cognitive 96) rpfm_ui/src/views/table/mod.rs:3177 — TableView::process_edition has cognitive complexity 96 (threshold 15). Drivers by points: if/else 16 (72 pts), loops 3 (16 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::go_to_definition (cognitive 75) rpfm_ui/src/views/table/mod.rs:3766 — TableView::go_to_definition has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (64 pts), match/switch 3 (9 pts), boolean chains 2 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::go_to_loc (cognitive 67) rpfm_ui/src/views/table/mod.rs:4020 — TableView::go_to_loc has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (58 pts), match/switch 2 (7 pts), boolean chains 2 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::paste_as_it_fits (cognitive 53) rpfm_ui/src/views/table/mod.rs:2188 — TableView::paste_as_it_fits has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 4 (12 pts), boolean chains 8, match/switch 2 (6 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::update_row_diff_marker (cognitive 47) rpfm_ui/src/views/table/mod.rs:3315 — TableView::update_row_diff_marker has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 2 (13 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::rewrite_selection (cognitive 46) rpfm_ui/src/views/table/mod.rs:1757 — TableView::rewrite_selection has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (36 pts), match/switch 1 (6 pts), loops 2 (4 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::get_indexes_as_lua_table (cognitive 39) rpfm_ui/src/views/table/mod.rs:2484 — TableView::get_indexes_as_lua_table has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::patch_column (cognitive 38) rpfm_ui/src/views/table/mod.rs:3519 — TableView::patch_column has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 9, match/switch 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::undo_redo (cognitive 35) rpfm_ui/src/views/table/mod.rs:2306 — TableView::undo_redo has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (11 pts), boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::revert_values (cognitive 33) rpfm_ui/src/views/table/mod.rs:1831 — TableView::revert_values has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 3 (6 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableView::smart_delete (cognitive 30) rpfm_ui/src/views/table/mod.rs:2870 — TableView::smart_delete has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (9 pts), match/switch 2 (9 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::new_view (cognitive 29) rpfm_ui/src/views/table/mod.rs:398 — TableView::new_view has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (23 pts), loops 4, boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • TableView::paste (cognitive 25) rpfm_ui/src/views/table/mod.rs:2086 — TableView::paste has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::copy_selection (cognitive 24) rpfm_ui/src/views/table/mod.rs:1940 — TableView::copy_selection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::context_menu_update (cognitive 19) rpfm_ui/src/views/table/mod.rs:1407 — TableView::context_menu_update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::generate_ids (cognitive 19) rpfm_ui/src/views/table/mod.rs:1898 — TableView::generate_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::filter_table_with_preview (cognitive 18) rpfm_ui/src/views/table/mod.rs:1644 — TableView::filter_table_with_preview has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • TableView::escape_string_from_index (cognitive 18) rpfm_ui/src/views/table/mod.rs:2579 — TableView::escape_string_from_index has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (nesting depth added 7). 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.
  • TableView::insert_rows (cognitive 18) rpfm_ui/src/views/table/mod.rs:2698 — TableView::insert_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::reset_selection (cognitive 16) rpfm_ui/src/views/table/mod.rs:1711 — TableView::reset_selection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableView::copy_selection_as_lua_table (cognitive 16) rpfm_ui/src/views/table/mod.rs:1997 — TableView::copy_selection_as_lua_table has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rpfm_extensions · ×23
  • rpfm_extensions::merge::delta_merge_rows (cognitive 33) rpfm_extensions/src/merge/mod.rs:224 — rpfm_extensions::merge::delta_merge_rows has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (9 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::validation::validate_references (cognitive 31) rpfm_extensions/src/startpos/validation.rs:177 — rpfm_extensions::startpos::validation::validate_references has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::lua::parse_function_block (cognitive 26) rpfm_extensions/src/lua/mod.rs:616 — rpfm_extensions::lua::parse_function_block has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::cai::technologies::faction_technologies (cognitive 25) rpfm_extensions/src/startpos/cai/technologies.rs:48 — rpfm_extensions::startpos::cai::technologies::faction_technologies has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::search::replace_match_string (cognitive 24) rpfm_extensions/src/search/mod.rs:1312 — rpfm_extensions::search::replace_match_string has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::compare::compare_tables (cognitive 24) rpfm_extensions/src/startpos/extract/compare.rs:185 — rpfm_extensions::startpos::extract::compare::compare_tables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::regions::province_values (cognitive 24) rpfm_extensions/src/startpos/extract/regions.rs:289 — rpfm_extensions::startpos::extract::regions::province_values has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::world::availability::available_chains (cognitive 24) rpfm_extensions/src/startpos/world/availability.rs:43 — rpfm_extensions::startpos::world::availability::available_chains has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::characters::push_forces (cognitive 23) rpfm_extensions/src/startpos/extract/characters.rs:264 — rpfm_extensions::startpos::extract::characters::push_forces has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::factions::diplomacy (cognitive 23) rpfm_extensions/src/startpos/extract/factions.rs:150 — rpfm_extensions::startpos::extract::factions::diplomacy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::gltf::gltf_from_rigid (cognitive 21) rpfm_extensions/src/gltf/mod.rs:109 — rpfm_extensions::gltf::gltf_from_rigid has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (6 pts), match/switch 1 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::cai::settlements::write_building_slots (cognitive 20) rpfm_extensions/src/startpos/cai/settlements.rs:164 — rpfm_extensions::startpos::cai::settlements::write_building_slots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::characters::extract (cognitive 20) rpfm_extensions/src/startpos/extract/characters.rs:112 — rpfm_extensions::startpos::extract::characters::extract has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 7 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::cai::regions::region_links (cognitive 18) rpfm_extensions/src/startpos/cai/regions.rs:106 — rpfm_extensions::startpos::cai::regions::region_links has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::regions::extract (cognitive 18) rpfm_extensions/src/startpos/extract/regions.rs:83 — rpfm_extensions::startpos::extract::regions::extract has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::world::garrisons::garrisons (cognitive 18) rpfm_extensions/src/startpos/world/garrisons.rs:96 — rpfm_extensions::startpos::world::garrisons::garrisons has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::validation::validate_adoptions (cognitive 17) rpfm_extensions/src/startpos/validation.rs:241 — rpfm_extensions::startpos::validation::validate_adoptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::world::husband_factions (cognitive 17) rpfm_extensions/src/startpos/world/mod.rs:463 — rpfm_extensions::startpos::world::husband_factions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::world::provinces::sea_regions (cognitive 17) rpfm_extensions/src/startpos/world/provinces.rs:131 — rpfm_extensions::startpos::world::provinces::sea_regions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::writer::international_routes::plan_routes (cognitive 17) rpfm_extensions/src/startpos/writer/international_routes.rs:170 — rpfm_extensions::startpos::writer::international_routes::plan_routes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::extract::characters::push_family (cognitive 16) rpfm_extensions/src/startpos/extract/characters.rs:349 — rpfm_extensions::startpos::extract::characters::push_family has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::validation::validate_name_kinds (cognitive 16) rpfm_extensions/src/startpos/validation.rs:272 — rpfm_extensions::startpos::validation::validate_name_kinds has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_extensions::startpos::world::bodyguards::bodyguard (cognitive 16) rpfm_extensions/src/startpos/world/bodyguards.rs:71 — rpfm_extensions::startpos::world::bodyguards::bodyguard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×23
  • Duplicated block (9 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1263 — rpfm_extensions/src/dependencies/mod.rs:1263-1271 | rpfm_extensions/src/dependencies/mod.rs:1283-1291 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1263` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2648 — rpfm_extensions/src/dependencies/mod.rs:2648-2656 | rpfm_extensions/src/dependencies/mod.rs:2820-2828 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2648` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_extensions/src/diagnostics/table.rs:741 — rpfm_extensions/src/diagnostics/table.rs:741-749 | rpfm_extensions/src/diagnostics/table.rs:796-804 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/diagnostics/table.rs:741` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_extensions/src/merge/mod.rs:187 — rpfm_extensions/src/merge/mod.rs:187-195 | rpfm_extensions/src/merge/mod.rs:205-213 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/merge/mod.rs:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/files/rigidmodel/vertices/mod.rs:359 — rpfm_lib/src/files/rigidmodel/vertices/mod.rs:359-367 | rpfm_lib/src/files/rigidmodel/vertices/mod.rs:374-382 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/rigidmodel/vertices/mod.rs:359` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/files/rigidmodel/vertices/mod.rs:547 — rpfm_lib/src/files/rigidmodel/vertices/mod.rs:547-555 | rpfm_lib/src/files/rigidmodel/vertices/mod.rs:560-568 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/rigidmodel/vertices/mod.rs:547` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/games/supported_games.rs:2459 — rpfm_lib/src/games/supported_games.rs:2459-2467 | rpfm_lib/src/games/supported_games.rs:2662-2670 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:2459` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/games/supported_games.rs:3043 — rpfm_lib/src/games/supported_games.rs:3043-3051 | rpfm_lib/src/games/supported_games.rs:3372-3380 — both copies are in the same file, so extract the 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) rpfm_lib/src/games/supported_games.rs:3358 — rpfm_lib/src/games/supported_games.rs:3358-3366 | rpfm_lib/src/games/supported_games.rs:3821-3829 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:3358` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/integrations/assembly_kit/mod.rs:538 — rpfm_lib/src/integrations/assembly_kit/mod.rs:538-546 | rpfm_lib/src/integrations/assembly_kit/mod.rs:578-586 — both copies are in the same file, so extract the 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 `rpfm_lib/src/integrations/assembly_kit/mod.rs:538` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_ui/src/app_ui/mod.rs:1144 — rpfm_ui/src/app_ui/mod.rs:1144-1152 | rpfm_ui/src/app_ui/mod.rs:1241-1249 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:1144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_ui/src/global_search_ui/slots.rs:130 — rpfm_ui/src/global_search_ui/slots.rs:130-138 | rpfm_ui/src/global_search_ui/slots.rs:189-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/global_search_ui/slots.rs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:371 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:371-379 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:411-419 — both copies are in the same file, so extract the 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) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:462 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:462-470 | rpfm_ui/src/tools/translator/mod.rs:997-1005 — 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 `rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:462` 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) rpfm_ui/src/views/table/columns_popover/mod.rs:199 — rpfm_ui/src/views/table/columns_popover/mod.rs:199-209 | rpfm_ui/src/views/table/columns_popover/mod.rs:235-243 — both copies are in the same file, so extract the 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) rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:245 — rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:245-253 | rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:285-293 — both copies are in the same file, so extract the 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) rpfm_ui/src/global_search_ui/mod.rs:1071 — rpfm_ui/src/global_search_ui/mod.rs:1071-1079 | rpfm_ui/src/global_search_ui/mod.rs:1166-1174 — both copies are in the same file, so extract the 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 `rpfm_ui/src/global_search_ui/mod.rs:1071` 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) rpfm_ui/src/app_ui/slots.rs:1228 — rpfm_ui/src/app_ui/slots.rs:1228-1242 | rpfm_ui/src/app_ui/slots.rs:1254-1262 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/slots.rs:1228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/app_ui/slots.rs:1251` calls `show_dialog` and `rpfm_ui/src/app_ui/slots.rs:1228` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:47 — rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:47-55 | rpfm_lib/src/files/tile_database/render_params/mod.rs:104-112 — 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 `rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/schema/mod.rs:2285 — rpfm_lib/src/schema/mod.rs:2285-2293 | rpfm_lib/src/schema/mod.rs:2313-2321 — both copies are in the same file, so extract the 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 `rpfm_lib/src/schema/mod.rs:2285` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_ui/src/packedfile_views/decoder/slots.rs:468 — rpfm_ui/src/packedfile_views/decoder/slots.rs:468-476 | rpfm_ui/src/packedfile_views/decoder/slots.rs:497-505 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/decoder/slots.rs:468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_ui/src/app_ui/mod.rs:3536 — rpfm_ui/src/app_ui/mod.rs:3536-3544 | rpfm_ui/src/app_ui/mod.rs:3557-3565 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:3536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rpfm_lib/src/files/bmd/prop_list/mod.rs:72 — rpfm_lib/src/files/bmd/prop_list/mod.rs:72-80 | rpfm_lib/src/files/tile_database/tile_variation/mod.rs:78-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. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/prop_list/mod.rs:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×23
  • Duplicated block (5 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1307 — rpfm_extensions/src/dependencies/mod.rs:1307-1311 | rpfm_extensions/src/dependencies/mod.rs:1329-1333 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:60 — rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:60-64 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:64-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:59` calls `read_v5` and `rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:63` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:79 — rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:79-83 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:82-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:78` calls `write_v5` and `rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:81` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) rpfm_ui/src/app_ui/mod.rs:2134 — rpfm_ui/src/app_ui/mod.rs:2134-2138 | rpfm_ui/src/app_ui/slots.rs:369-375 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:2134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/decoder/mod.rs:414 — rpfm_ui/src/packedfile_views/decoder/mod.rs:414-419 | rpfm_ui/src/views/table/mod.rs:633-637 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:176 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:176-180 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:400-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:278 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:278-282 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:307-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:312` calls `from_q_string_q_widget`, `from_std_str` and `rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:283` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:297 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:297-301 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:334-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:213 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:213-217 | rpfm_ui/src/tools/translator/mod.rs:558-562 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) rpfm_ui/src/views/table/mod.rs:2586 — rpfm_ui/src/views/table/mod.rs:2586-2590 | rpfm_ui/src/views/table/mod.rs:2599-2603 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/mod.rs:2586` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_ui_common/src/locale.rs:124 — rpfm_ui_common/src/locale.rs:124-128 | rpfm_ui_common/src/locale.rs:137-141 — both copies are in the same file, so extract the 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 `rpfm_ui_common/src/locale.rs:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_ui/src/welcome_page_ui/mod.rs:137 — rpfm_ui/src/welcome_page_ui/mod.rs:137-141 | rpfm_ui/src/welcome_page_ui/mod.rs:145-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_ui/src/settings_ui/mod.rs:365 — rpfm_ui/src/settings_ui/mod.rs:365-369 | rpfm_ui/src/settings_ui/mod.rs:559-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/settings_ui/mod.rs:362` calls `set_style_sheet`, `from_std_str`, `from_q_string_q_widget` and `rpfm_ui/src/settings_ui/mod.rs:558` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) rpfm_ui/src/views/table/mod.rs:3603 — rpfm_ui/src/views/table/mod.rs:3603-3607 | rpfm_ui/src/views/table/mod.rs:3740-3744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2200 — rpfm_extensions/src/dependencies/mod.rs:2200-2204 | rpfm_extensions/src/dependencies/mod.rs:2259-2263 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_lib/src/files/table/mod.rs:876 — rpfm_lib/src/files/table/mod.rs:876-880 | rpfm_lib/src/files/table/mod.rs:895-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_lib/src/integrations/git.rs:306 — rpfm_lib/src/integrations/git.rs:306-310 | rpfm_lib/src/integrations/git.rs:377-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_lib/src/schema/v4.rs:240 — rpfm_lib/src/schema/v4.rs:240-244 | rpfm_lib/src/schema/v4.rs:447-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/decoder/mod.rs:364 — rpfm_ui/src/packedfile_views/decoder/mod.rs:364-368 | rpfm_ui/src/packedfile_views/video/mod.rs:109-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:665 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:665-669 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:686-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rpfm_ui/src/packedfile_views/text/mod.rs:143 — rpfm_ui/src/packedfile_views/text/mod.rs:143-147 | rpfm_ui/src/packedfile_views/vmd/mod.rs:174-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) rpfm_ui/src/views/table/mod.rs:2158 — rpfm_ui/src/views/table/mod.rs:2158-2162 | rpfm_ui/src/views/table/mod.rs:2181-2185 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/mod.rs:2158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rpfm_ui/src/views/table/mod.rs:2689 — rpfm_ui/src/views/table/mod.rs:2689-2693 | rpfm_ui/src/views/table/mod.rs:2759-2763 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/mod.rs:2689` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/views/table/mod.rs:2687` calls `row_count_0a` and `rpfm_ui/src/views/table/mod.rs:2756` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D2 · Cognitive Complexity · rpfm_ui · ×22
  • rpfm_ui::app_ui::slots::handle_tab_current_changed (cognitive 170) rpfm_ui/src/app_ui/slots.rs:243 — rpfm_ui::app_ui::slots::handle_tab_current_changed has cognitive complexity 170 (threshold 15). Drivers by points: if/else 22 (121 pts), loops 5 (36 pts), match/switch 1 (10 pts), boolean chains 3 (nesting depth added 139). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::views::table::utils::load_data (cognitive 128) rpfm_ui/src/views/table/utils.rs:416 — rpfm_ui::views::table::utils::load_data has cognitive complexity 128 (threshold 15). Drivers by points: if/else 27 (95 pts), loops 5 (16 pts), match/switch 3 (14 pts), boolean chains 3 (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::communications::websocket_loop (cognitive 91) rpfm_ui/src/communications/mod.rs:385 — rpfm_ui::communications::websocket_loop has cognitive complexity 91 (threshold 15). Drivers by points: if/else 16 (74 pts), match/switch 4 (13 pts), loops 2 (4 pts) (nesting depth added 69). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::packedfile_views::esf::esftree::get_node_type_from_tree_node (cognitive 71) rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:226 — rpfm_ui::packedfile_views::esf::esftree::get_node_type_from_tree_node has cognitive complexity 71 (threshold 15). Drivers by points: if/else 14 (45 pts), loops 5 (19 pts), match/switch 3 (7 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::views::table::utils::build_columns (cognitive 53) rpfm_ui/src/views/table/utils.rs:745 — rpfm_ui::views::table::utils::build_columns has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 5 (18 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::app_ui::slots::handle_tab_unpreview (cognitive 46) rpfm_ui/src/app_ui/slots.rs:400 — rpfm_ui::app_ui::slots::handle_tab_unpreview has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (42 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::pack_tree::sort_item_in_tree_view (cognitive 42) rpfm_ui/src/pack_tree/mod.rs:1945 — rpfm_ui::pack_tree::sort_item_in_tree_view has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 7, match/switch 2 (6 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::packedfile_views::esf::esftree::load_node_to_view (cognitive 36) rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:149 — rpfm_ui::packedfile_views::esf::esftree::load_node_to_view has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (10 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::views::table::utils::setup_item_delegates (cognitive 36) rpfm_ui/src/views/table/utils.rs:1117 — rpfm_ui::views::table::utils::setup_item_delegates has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::ffi::generate_tooltip_message (cognitive 35) rpfm_ui/src/ffi/mod.rs:959 — rpfm_ui::ffi::generate_tooltip_message has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (32 pts), boolean chains 3 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::views::table::utils::get_column_tooltips (cognitive 35) rpfm_ui/src/views/table/utils.rs:925 — rpfm_ui::views::table::utils::get_column_tooltips has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 1 (4 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::views::table::utils::get_default_item_from_field (cognitive 34) rpfm_ui/src/views/table/utils.rs:239 — rpfm_ui::views::table::utils::get_default_item_from_field has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (33 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::tools::ceo_builder::build_ceo_builder (cognitive 32) rpfm_ui/src/tools/ceo_builder/mod.rs:126 — rpfm_ui::tools::ceo_builder::build_ceo_builder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (19 pts), loops 9, boolean chains 2, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • rpfm_ui::views::table::utils::open_subtable (cognitive 32) rpfm_ui/src/views/table/utils.rs:1291 — rpfm_ui::views::table::utils::open_subtable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (27 pts), match/switch 1 (5 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_ui::command_palette_ui::collect_actions_from_menu (cognitive 24) rpfm_ui/src/command_palette_ui/mod.rs:226 — rpfm_ui::command_palette_ui::collect_actions_from_menu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::command_palette_ui::show_command_palette (cognitive 23) rpfm_ui/src/command_palette_ui/mod.rs:114 — rpfm_ui::command_palette_ui::show_command_palette has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::diagnostics_ui::slots::ignore_selection (cognitive 21) rpfm_ui/src/diagnostics_ui/slots.rs:395 — rpfm_ui::diagnostics_ui::slots::ignore_selection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::views::table::filter::parse_predicate (cognitive 19) rpfm_ui/src/views/table/filter/mod.rs:308 — rpfm_ui::views::table::filter::parse_predicate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::views::table::utils::get_item_from_decoded_data (cognitive 19) rpfm_ui/src/views/table/utils.rs:619 — rpfm_ui::views::table::utils::get_item_from_decoded_data has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::views::table::utils::request_backend_files (cognitive 19) rpfm_ui/src/views/table/utils.rs:1372 — rpfm_ui::views::table::utils::request_backend_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::command_palette_ui::collect_files_recursive (cognitive 18) rpfm_ui/src/command_palette_ui/mod.rs:194 — rpfm_ui::command_palette_ui::collect_files_recursive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_ui::ffi::assets_request_callback (cognitive 18) rpfm_ui/src/ffi/mod.rs:804 — rpfm_ui::ffi::assets_request_callback has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 5 (7 pts), loops 2 (nesting depth added 8). 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×22
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/mod.rs:2368 — `encode` is public and takes a `RFile` as its receiver from its caller, and it calls itself at line 2368 with a piece of the document (and at line 2369, line 2370, line 2371, line 2372, line 2373, line 2374, line 2375, line 2376, line 2377, line 2378, line 2379, line 2380, line 2381, line 2382, line 2383, line 2384, line 2385, line 2386, line 2387, line 2388, line 2389, line 2390, line 2391, line 2392, line 2393, line 2394, line 2395, line 2396) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/mod.rs:2863 — `update` is public and takes a `RFile` as its receiver from its caller, and it calls itself at line 2863 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `update` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:444 — `insert` is public and takes a `Pack` as its receiver from its caller, and it recurses at line 444 through `write`, `encode` and back with a piece of the document (and at line 431, line 434, line 437, line 564, line 745, line 751, line 757) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `insert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1033 — `pfh_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1033 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `pfh_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1038 — `pfh_file_type` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1038 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `pfh_file_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1043 — `bitmask` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1043 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `bitmask` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1048 — `internal_timestamp` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1048 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `internal_timestamp` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1053 — `game_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1053 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `game_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1058 — `build_number` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1058 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `build_number` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1063 — `authoring_tool` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1063 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `authoring_tool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1068 — `extra_subheader_data` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1068 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `extra_subheader_data` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1092 — `set_pfh_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1092 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_pfh_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1097 — `set_pfh_file_type` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1097 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_pfh_file_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1102 — `set_bitmask` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1102 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_bitmask` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1107 — `set_internal_timestamp` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1107 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_internal_timestamp` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1112 — `set_game_version` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1112 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_game_version` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1117 — `set_build_number` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1117 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_build_number` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1122 — `set_authoring_tool` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1122 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_authoring_tool` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/pack/mod.rs:1127 — `set_extra_subheader_data` is public and takes a `Pack` as its receiver from its caller, and it calls itself at line 1127 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_extra_subheader_data` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/esf/utils.rs:1069 — `save_node` is public and takes `node_type: &NodeType` from its caller, and it calls itself at line 1069 with a piece of the document (and at line 1084) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `save_node` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/esf/utils.rs:1137 — `read_string_from_node` is public and takes `node_type: &NodeType` from its caller, and it calls itself at line 1137 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `read_string_from_node` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap rpfm_lib/src/files/animpack/mod.rs:408 — `encode` is public and takes a `AnimPack` as its receiver from its caller, and it calls itself at line 408 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D3 · God Classes · TooManyFields · ×21
  • TooManyFields: AppUI rpfm_ui/src/app_ui/mod.rs:195 — TooManyFields — 107 stored fields beside 50 methods. The bar is 30 stored fields; this is 77 over it, 3.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TableView rpfm_ui/src/views/table/mod.rs:209 — TooManyFields — 82 stored fields beside 71 methods. The bar is 30 stored fields; this is 52 over it, 2.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DiagnosticsUI rpfm_ui/src/diagnostics_ui/mod.rs:123 — TooManyFields — 82 stored fields beside 29 methods. The bar is 30 stored fields; this is 52 over it, 2.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PackFileContentsUI rpfm_ui/src/packfile_contents_ui/mod.rs:86 — TooManyFields — 79 stored fields beside 11 methods. The bar is 30 stored fields; this is 49 over it, 2.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PortraitSettingsView rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:90 — TooManyFields — 76 stored fields beside 24 methods. The bar is 30 stored fields; this is 46 over it, 2.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PackFileContentsSlots rpfm_ui/src/packfile_contents_ui/slots.rs:88 — TooManyFields — 71 stored fields beside 1 method. The bar is 30 stored fields; this is 41 over it, 2.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AppUISlots rpfm_ui/src/app_ui/slots.rs:107 — TooManyFields — 69 stored fields beside 1 method. The bar is 30 stored fields; this is 39 over it, 2.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PackedFileDecoderView rpfm_ui/src/packedfile_views/decoder/mod.rs:96 — TooManyFields — 58 stored fields beside 13 methods. The bar is 30 stored fields; this is 28 over it, 1.93× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ToolTranslator rpfm_ui/src/tools/translator/mod.rs:200 — TooManyFields — 54 stored fields beside 35 methods. The bar is 30 stored fields; this is 24 over it, 1.80× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: GroupFormationsView rpfm_ui/src/packedfile_views/group_formations/mod.rs:157 — TooManyFields — 53 stored fields beside 43 methods. The bar is 30 stored fields; this is 23 over it, 1.77× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Icons rpfm_ui_common/src/icons/mod.rs:42 — TooManyFields — 51 stored fields beside 4 methods. The bar is 30 stored fields; this is 21 over it, 1.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: GlobalSearchUI rpfm_ui/src/global_search_ui/mod.rs:175 — TooManyFields — 50 stored fields beside 32 methods. The bar is 30 stored fields; this is 20 over it, 1.67× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EventData rpfm_lib/src/files/sound_events/mod.rs:144 — TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TableViewSlots rpfm_ui/src/views/table/slots.rs:65 — TooManyFields — 46 stored fields beside 1 method. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: GroupFormationsSlots rpfm_ui/src/packedfile_views/group_formations/slots.rs:58 — TooManyFields — 40 stored fields beside 1 method. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: SubToolVariantUnitEditor rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:91 — TooManyFields — 39 stored fields beside 25 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: SettingsUI rpfm_ui/src/settings_ui/mod.rs:127 — TooManyFields — 39 stored fields beside 8 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Material rpfm_lib/src/files/rigidmodel/materials/mod.rs:268 — TooManyFields — 36 stored fields beside 34 methods. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Bmd rpfm_lib/src/files/bmd/mod.rs:316 — TooManyFields — 35 stored fields beside 15 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ToolUnitEditor rpfm_ui/src/tools/unit_editor/mod.rs:140 — TooManyFields — 34 stored fields beside 33 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PackedFileDecoderViewSlots rpfm_ui/src/packedfile_views/decoder/slots.rs:53 — TooManyFields — 34 stored fields beside 1 method. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
X18 · Disposal-pattern correctness · Explicit release owed and not made on every path · ×21
  • Explicit release owed and not made on every path rpfm_ui_common/src/tools/mod.rs:68 — `file` (line 68) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_ui/src/views/table/mod.rs:1252 — `file` (line 1252) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_telemetry/src/logger.rs:404 — `file` (line 404) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_server/src/state/tools.rs:847 — `file` (line 847) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_server/src/state/tools.rs:860 — `file` (line 860) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_server/src/state/tools.rs:875 — `file` (line 875) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/schema/mod.rs:618 — `file` (line 618) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/schema/mod.rs:647 — `file` (line 647) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/schema/mod.rs:682 — `file` (line 682) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/schema/mod.rs:1007 — `file` (line 1007) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/schema/mod.rs:1078 — `file` (line 1078) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/integrations/git.rs:169 — `file` (line 169) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/files/mod.rs:2896 — `file` (line 2896) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/files/pack/mod.rs:1462 — `file` (line 1462) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/files/bmd/mod.rs:574 — `terry_file` (line 574) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_lib/src/files/bmd/mod.rs:691 — `layer_file` (line 691) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_ipc/src/settings.rs:427 — `file` (line 427) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_ipc/src/settings.rs:728 — `file` (line 728) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_extensions/src/translator/mod.rs:705 — `file` (line 705) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_extensions/src/startpos/layout.rs:317 — `file` (line 317) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path rpfm_extensions/src/gltf/mod.rs:494 — `writer_gltf` (line 494) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
D2 · Cognitive Complexity · Cs2Parsed · ×18
  • Cs2Parsed::read_v12 (cognitive 57) rpfm_lib/src/files/cs2_parsed/versions/v12.rs:22 — Cs2Parsed::read_v12 has cognitive complexity 57 (threshold 15). Drivers by points: loops 19 (57 pts) (nesting depth added 38). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v12) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v12 (cognitive 57) rpfm_lib/src/files/cs2_parsed/versions/v12.rs:202 — Cs2Parsed::write_v12 has cognitive complexity 57 (threshold 15). Drivers by points: loops 19 (57 pts) (nesting depth added 38). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v12) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v13 (cognitive 57) rpfm_lib/src/files/cs2_parsed/versions/v13.rs:22 — Cs2Parsed::read_v13 has cognitive complexity 57 (threshold 15). Drivers by points: loops 19 (57 pts) (nesting depth added 38). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v13) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v13 (cognitive 57) rpfm_lib/src/files/cs2_parsed/versions/v13.rs:202 — Cs2Parsed::write_v13 has cognitive complexity 57 (threshold 15). Drivers by points: loops 19 (57 pts) (nesting depth added 38). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v13) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v20 (cognitive 54) rpfm_lib/src/files/cs2_parsed/versions/v20.rs:22 — Cs2Parsed::read_v20 has cognitive complexity 54 (threshold 15). Drivers by points: loops 18 (54 pts) (nesting depth added 36). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v20) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v20 (cognitive 54) rpfm_lib/src/files/cs2_parsed/versions/v20.rs:186 — Cs2Parsed::write_v20 has cognitive complexity 54 (threshold 15). Drivers by points: loops 18 (54 pts) (nesting depth added 36). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v20) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v21 (cognitive 54) rpfm_lib/src/files/cs2_parsed/versions/v21.rs:22 — Cs2Parsed::read_v21 has cognitive complexity 54 (threshold 15). Drivers by points: loops 18 (54 pts) (nesting depth added 36). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v21) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v21 (cognitive 54) rpfm_lib/src/files/cs2_parsed/versions/v21.rs:188 — Cs2Parsed::write_v21 has cognitive complexity 54 (threshold 15). Drivers by points: loops 18 (54 pts) (nesting depth added 36). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v21) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v18 (cognitive 47) rpfm_lib/src/files/cs2_parsed/versions/v18.rs:22 — Cs2Parsed::read_v18 has cognitive complexity 47 (threshold 15). Drivers by points: loops 16 (47 pts) (nesting depth added 31). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v18) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v18 (cognitive 47) rpfm_lib/src/files/cs2_parsed/versions/v18.rs:179 — Cs2Parsed::write_v18 has cognitive complexity 47 (threshold 15). Drivers by points: loops 16 (47 pts) (nesting depth added 31). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v18) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v10 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v10.rs:22 — Cs2Parsed::read_v10 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v10) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v10 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v10.rs:164 — Cs2Parsed::write_v10 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v10) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v11 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v11.rs:22 — Cs2Parsed::read_v11 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v11) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v11 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v11.rs:164 — Cs2Parsed::write_v11 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v11) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v8 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v8.rs:22 — Cs2Parsed::read_v8 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v8) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v8 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v8.rs:162 — Cs2Parsed::write_v8 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v8) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v9 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v9.rs:22 — Cs2Parsed::read_v9 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v9) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v9 (cognitive 34) rpfm_lib/src/files/cs2_parsed/versions/v9.rs:164 — Cs2Parsed::write_v9 has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (34 pts) (nesting depth added 22). 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v9) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×17
  • Duplicated block (10 lines × 2) rpfm_extensions/src/dependencies/mod.rs:3324 — rpfm_extensions/src/dependencies/mod.rs:3324-3333 | rpfm_extensions/src/dependencies/mod.rs:3429-3438 — both copies are in the same file, so extract the 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 (10 lines × 2) rpfm_extensions/src/gltf/mod.rs:166 — rpfm_extensions/src/gltf/mod.rs:166-175 | rpfm_extensions/src/gltf/mod.rs:380-389 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/gltf/mod.rs:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:42 — rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:42-51 | rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs:42-51 — before extracting anything, compare `rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs` and `rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) rpfm_lib/src/files/esf/utils.rs:336 — rpfm_lib/src/files/esf/utils.rs:336-345 | rpfm_lib/src/files/esf/utils.rs:511-523 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/esf/utils.rs:336` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_ui/src/app_ui/mod.rs:1141 — rpfm_ui/src/app_ui/mod.rs:1141-1150 | rpfm_ui/src/app_ui/mod.rs:1181-1190 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:1141` 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) rpfm_ui/src/app_ui/mod.rs:1343 — rpfm_ui/src/app_ui/mod.rs:1343-1352 | rpfm_ui/src/app_ui/mod.rs:1358-1367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:1343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:477 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:477-486 | rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:489-498 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:477` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:2403 — rpfm_ui/src/packfile_contents_ui/slots.rs:2403-2412 | rpfm_ui/src/packfile_contents_ui/slots.rs:2415-2425 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:2403` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:679 — rpfm_ui/src/tools/faction_painter/mod.rs:679-688 | rpfm_ui/src/tools/faction_painter/mod.rs:805-814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:679` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_ui/src/tools/mod.rs:752 — rpfm_ui/src/tools/mod.rs:752-761 | rpfm_ui/src/tools/mod.rs:1079-1088 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:752` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) rpfm_ui/src/tools/translator/mod.rs:1012 — rpfm_ui/src/tools/translator/mod.rs:1012-1021 | rpfm_ui/src/tools/translator/mod.rs:1024-1033 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/translator/mod.rs:1012` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_lib/src/files/atlas/mod.rs:199 — rpfm_lib/src/files/atlas/mod.rs:199-213 | rpfm_lib/src/files/loc/mod.rs:154-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:56 — rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:56-65 | rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs:56-65 — before extracting anything, compare `rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs` and `rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:1645 — rpfm_ui/src/packfile_contents_ui/slots.rs:1645-1655 | rpfm_ui/src/packfile_contents_ui/slots.rs:1679-1688 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:1645` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:2202 — rpfm_ui/src/packfile_contents_ui/slots.rs:2202-2211 | rpfm_ui/src/packfile_contents_ui/slots.rs:2221-2230 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:2202` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:943 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:943-952 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:966-975 — both copies are in the same file, so extract the 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 (10 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1012 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1012-1021 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1035-1044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · AppUI · ×16
  • AppUI::open_packedfile (cognitive 337) rpfm_ui/src/app_ui/mod.rs:2019 — AppUI::open_packedfile has cognitive complexity 337 (threshold 15). Drivers by points: if/else 57 (224 pts), match/switch 22 (104 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 251). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::build_pack_submenus (cognitive 65) rpfm_ui/src/app_ui/mod.rs:1700 — AppUI::build_pack_submenus has cognitive complexity 65 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 6 (14 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::build_open_mymod_submenus (cognitive 53) rpfm_ui/src/app_ui/mod.rs:1921 — AppUI::build_open_mymod_submenus has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (37 pts), loops 2 (9 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::update_views_names (cognitive 53) rpfm_ui/src/app_ui/mod.rs:3866 — AppUI::update_views_names has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (39 pts), match/switch 3 (9 pts), loops 3, boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::new_queek_packed_file (cognitive 52) rpfm_ui/src/app_ui/mod.rs:2984 — AppUI::new_queek_packed_file has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (37 pts), match/switch 3 (9 pts), boolean chains 6 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::change_game_selected (cognitive 45) rpfm_ui/src/app_ui/mod.rs:4053 — AppUI::change_game_selected has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (31 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::new_file_dialog (cognitive 43) rpfm_ui/src/app_ui/mod.rs:3103 — AppUI::new_file_dialog has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 3 (7 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::new_file (cognitive 37) rpfm_ui/src/app_ui/mod.rs:2889 — AppUI::new_file has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 4 (10 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::purge_that_one_specifically (cognitive 35) rpfm_ui/src/app_ui/mod.rs:1218 — AppUI::purge_that_one_specifically has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::open_special_view (cognitive 32) rpfm_ui/src/app_ui/mod.rs:2762 — AppUI::open_special_view has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 5 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). 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.
  • AppUI::toggle_main_window (cognitive 31) rpfm_ui/src/app_ui/mod.rs:996 — AppUI::toggle_main_window has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppUI::save_packfile_by_key (cognitive 28) rpfm_ui/src/app_ui/mod.rs:1457 — AppUI::save_packfile_by_key has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::open_packfile (cognitive 27) rpfm_ui/src/app_ui/mod.rs:1289 — AppUI::open_packfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::pack_map_dialog (cognitive 23) rpfm_ui/src/app_ui/mod.rs:3473 — AppUI::pack_map_dialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 6, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AppUI::build_starpos (cognitive 22) rpfm_ui/src/app_ui/mod.rs:4363 — AppUI::build_starpos has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • AppUI::file_view_hide (cognitive 19) rpfm_ui/src/app_ui/mod.rs:3977 — AppUI::file_view_hide has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D2 · Cognitive Complexity · Pack · ×14
  • Pack::optimize (cognitive 144) rpfm_extensions/src/optimizer/mod.rs:299 — Pack::optimize has cognitive complexity 144 (threshold 15). Drivers by points: if/else 33 (100 pts), boolean chains 19, loops 6 (18 pts), match/switch 3 (7 pts) (nesting depth added 83). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Pack::generate_missing_loc_data (cognitive 66) rpfm_lib/src/files/pack/mod.rs:1194 — Pack::generate_missing_loc_data has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 2 (8 pts), boolean chains 3 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Pack::update_anim_ids (cognitive 57) rpfm_lib/src/files/pack/mod.rs:1469 — Pack::update_anim_ids has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (46 pts), loops 4 (11 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Pack::write_pfh3 (cognitive 36) rpfm_lib/src/files/pack/pack_versions/pfh3.rs:98 — Pack::write_pfh3 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Pack::move_path (cognitive 31) rpfm_lib/src/files/pack/mod.rs:485 — Pack::move_path has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 4 (8 pts), loops 1 (3 pts) (nesting depth added 19). 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.
  • Pack::write_pfh6 (cognitive 31) rpfm_lib/src/files/pack/pack_versions/pfh6.rs:128 — Pack::write_pfh6 has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (24 pts), loops 3, boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Pack::patch_siege_ai (cognitive 30) rpfm_lib/src/files/pack/mod.rs:1317 — Pack::patch_siege_ai has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Pack::write_pfh5 (cognitive 30) rpfm_lib/src/files/pack/pack_versions/pfh5.rs:129 — Pack::write_pfh5 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (24 pts), loops 3, boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • Pack::read_pfh4 (cognitive 26) rpfm_lib/src/files/pack/pack_versions/pfh4.rs:26 — Pack::read_pfh4 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • Pack::read_pfh5 (cognitive 26) rpfm_lib/src/files/pack/pack_versions/pfh5.rs:27 — Pack::read_pfh5 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Pack::write_pfh4 (cognitive 24) rpfm_lib/src/files/pack/pack_versions/pfh4.rs:109 — Pack::write_pfh4 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (21 pts), loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • Pack::read (cognitive 22) rpfm_lib/src/files/pack/mod.rs:589 — Pack::read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Pack::read_pfh6 (cognitive 22) rpfm_lib/src/files/pack/pack_versions/pfh6.rs:30 — Pack::read_pfh6 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Pack::write_pfh2 (cognitive 16) rpfm_lib/src/files/pack/pack_versions/pfh2.rs:78 — Pack::write_pfh2 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D3 · God Classes · TooManyMethods · ×13
  • TooManyMethods: SessionState rpfm_server/src/state/mod.rs:66 — TooManyMethods — 188 methods, declared across 9 files: state/files.rs (39), state/tables.rs (37), state/tools.rs (37), state/packs.rs (30), +5 more file(s). The bar is 30 methods; this is 158 over it, 6.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: McpServer rpfm_server/src/server_mcp.rs:262 — TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TableView rpfm_ui/src/views/table/mod.rs:209 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dependencies rpfm_extensions/src/dependencies/mod.rs:201 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppUI rpfm_ui/src/app_ui/mod.rs:195 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Pack rpfm_lib/src/files/pack/mod.rs:240 — TooManyMethods — 47 methods, declared across 7 files: pack/mod.rs (35), pack_versions/pfh0.rs (2), pack_versions/pfh2.rs (2), pack_versions/pfh3.rs (2), +3 more file(s). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GroupFormationsView rpfm_ui/src/packedfile_views/group_formations/mod.rs:157 — TooManyMethods — 43 methods, declared across 2 files: group_formations/mod.rs (39), group_formations/slots.rs (4). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToolTranslator rpfm_ui/src/tools/translator/mod.rs:200 — TooManyMethods — 35 methods, declared across 2 files: translator/mod.rs (30), translator/hub.rs (5). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RFile rpfm_lib/src/files/mod.rs:296 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Material rpfm_lib/src/files/rigidmodel/materials/mod.rs:268 — TooManyMethods — 34 methods, declared across 17 files: materials/alpha_blend.rs (2), materials/cloth.rs (2), materials/collision_shape.rs (2), materials/custom_terrain.rs (2), +13 more file(s). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToolUnitEditor rpfm_ui/src/tools/unit_editor/mod.rs:140 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GlobalSearchUI rpfm_ui/src/global_search_ui/mod.rs:175 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Tool rpfm_ui/src/tools/mod.rs:139 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×13
  • Duplicated block (12 lines × 2) rpfm_extensions/src/dependencies/mod.rs:623 — rpfm_extensions/src/dependencies/mod.rs:623-634 | rpfm_extensions/src/dependencies/mod.rs:653-664 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:623` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rpfm_extensions/src/diagnostics/table.rs:406 — rpfm_extensions/src/diagnostics/table.rs:406-417 | rpfm_extensions/src/diagnostics/table.rs:426-437 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/diagnostics/table.rs:406` 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) rpfm_extensions/src/search/table.rs:116 — rpfm_extensions/src/search/table.rs:116-127 | rpfm_extensions/src/search/table.rs:133-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) rpfm_lib/src/files/esf/utils.rs:585 — rpfm_lib/src/files/esf/utils.rs:585-596 | rpfm_lib/src/files/esf/utils.rs:600-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/esf/utils.rs:585` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) rpfm_ui/src/diagnostics_ui/mod.rs:1305 — rpfm_ui/src/diagnostics_ui/mod.rs:1305-1316 | rpfm_ui/src/diagnostics_ui/mod.rs:1328-1339 — both copies are in the same file, so extract the 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 `rpfm_ui/src/diagnostics_ui/mod.rs:1305` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:360 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:360-371 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:181-192 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:391 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:391-402 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:209-220 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:390` calls `set_single_shot` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs:208` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:1045 — rpfm_ui/src/tools/faction_painter/mod.rs:1045-1056 | rpfm_ui/src/tools/faction_painter/mod.rs:1111-1122 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:1045` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) rpfm_ui/src/tools/mod.rs:721 — rpfm_ui/src/tools/mod.rs:721-732 | rpfm_ui/src/tools/mod.rs:1064-1075 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:721` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `&HashMap<String, String>` in one and `&mut HashMap<String, String>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) rpfm_ui/src/views/table/columns_popover/mod.rs:247 — rpfm_ui/src/views/table/columns_popover/mod.rs:247-258 | rpfm_ui/src/views/table/columns_popover/mod.rs:415-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2909 — rpfm_extensions/src/dependencies/mod.rs:2909-2920 | rpfm_extensions/src/dependencies/mod.rs:2949-2960 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2909` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rpfm_extensions/src/search/table.rs:81 — rpfm_extensions/src/search/table.rs:81-92 | rpfm_extensions/src/search/table.rs:99-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:1400 — rpfm_ui/src/packfile_contents_ui/slots.rs:1400-1411 | rpfm_ui/src/packfile_contents_ui/slots.rs:1416-1427 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:1400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×13
  • Duplicated block (11 lines × 2) rpfm_extensions/src/dependencies/mod.rs:3077 — rpfm_extensions/src/dependencies/mod.rs:3077-3087 | rpfm_extensions/src/dependencies/mod.rs:3379-3389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rpfm_lib/src/binary/reader.rs:661 — rpfm_lib/src/binary/reader.rs:661-671 | rpfm_lib/src/binary/reader.rs:870-880 — both copies are in the same file, so extract the 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 `rpfm_lib/src/binary/reader.rs:661` 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) rpfm_lib/src/files/esf/utils.rs:359 — rpfm_lib/src/files/esf/utils.rs:359-369 | rpfm_lib/src/files/esf/utils.rs:405-415 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/esf/utils.rs:359` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) rpfm_server/src/ceo_builder.rs:808 — rpfm_server/src/ceo_builder.rs:808-818 | rpfm_server/src/ceo_builder.rs:1090-1100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rpfm_ui/src/app_ui/mod.rs:3319 — rpfm_ui/src/app_ui/mod.rs:3319-3329 | rpfm_ui/src/app_ui/mod.rs:3355-3365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rpfm_ui/src/diagnostics_ui/mod.rs:1709 — rpfm_ui/src/diagnostics_ui/mod.rs:1709-1719 | rpfm_ui/src/diagnostics_ui/mod.rs:1760-1770 — both copies are in the same file, so extract the 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 `rpfm_ui/src/diagnostics_ui/mod.rs:1709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:2349 — rpfm_ui/src/packfile_contents_ui/slots.rs:2349-2359 | rpfm_ui/src/packfile_contents_ui/slots.rs:2391-2401 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:2349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rpfm_ui/src/tools/mod.rs:678 — rpfm_ui/src/tools/mod.rs:678-688 | rpfm_ui/src/tools/mod.rs:1042-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/mod.rs:678` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `&HashMap<String, String>` in one and `&mut HashMap<String, String>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/tools/mod.rs:1055` calls `is_reference`, `Some` and `rpfm_ui/src/tools/mod.rs:691` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) rpfm_ui/src/tools/mod.rs:816 — rpfm_ui/src/tools/mod.rs:816-826 | rpfm_ui/src/tools/mod.rs:1103-1113 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:816` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:810 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:810-820 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:883-893 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:810` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rpfm_ui/src/views/table/search/mod.rs:296 — rpfm_ui/src/views/table/search/mod.rs:296-306 | rpfm_ui/src/views/table/search/mod.rs:322-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 (11 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:1667 — rpfm_ui/src/packfile_contents_ui/slots.rs:1667-1677 | rpfm_ui/src/packfile_contents_ui/slots.rs:1690-1700 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:1667` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) rpfm_ui/src/packfile_contents_ui/slots.rs:1110 — rpfm_ui/src/packfile_contents_ui/slots.rs:1110-1120 | rpfm_ui/src/packfile_contents_ui/slots.rs:1192-1202 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/slots.rs:1110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×12
  • Duplicated block (13 lines × 2) rpfm_lib/src/files/animpack/mod.rs:289 — rpfm_lib/src/files/animpack/mod.rs:289-301 | rpfm_lib/src/files/pack/mod.rs:600-612 — 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) rpfm_lib/src/games/supported_games.rs:272 — rpfm_lib/src/games/supported_games.rs:272-284 | rpfm_lib/src/games/supported_games.rs:2938-2950 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:272` 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) rpfm_lib/src/games/supported_games.rs:434 — rpfm_lib/src/games/supported_games.rs:434-446 | rpfm_lib/src/games/supported_games.rs:633-645 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:434` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) rpfm_lib/src/games/supported_games.rs:3122 — rpfm_lib/src/games/supported_games.rs:3122-3134 | rpfm_lib/src/games/supported_games.rs:3532-3544 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:3122` 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) rpfm_ui/src/app_ui/mod.rs:3599 — rpfm_ui/src/app_ui/mod.rs:3599-3611 | rpfm_ui/src/app_ui/mod.rs:3643-3655 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:3599` 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) rpfm_ui/src/app_ui/mod.rs:4239 — rpfm_ui/src/app_ui/mod.rs:4239-4251 | rpfm_ui/src/packfile_contents_ui/mod.rs:731-743 — 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 `rpfm_ui/src/app_ui/mod.rs:4239` 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) rpfm_ui/src/packedfile_views/decoder/mod.rs:779 — rpfm_ui/src/packedfile_views/decoder/mod.rs:779-791 | rpfm_ui/src/packedfile_views/decoder/mod.rs:817-829 — both copies are in the same file, so extract the 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 (13 lines × 2) rpfm_ui/src/packfile_contents_ui/mod.rs:583 — rpfm_ui/src/packfile_contents_ui/mod.rs:583-595 | rpfm_ui/src/packfile_contents_ui/mod.rs:832-844 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packfile_contents_ui/mod.rs:583` 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) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:74 — rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:74-86 | rpfm_ui/src/packedfile_views/unit_variant/slots.rs:70-82 — `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs` and `rpfm_ui/src/packedfile_views/unit_variant/slots.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&Arc<PortraitSettingsView>` in one and `&Arc<UnitVariantView>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:894 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:894-906 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:389-401 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:894` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) rpfm_lib/src/files/sound_bank/sections/hirc/object/actor_mixer/mod.rs:35 — rpfm_lib/src/files/sound_bank/sections/hirc/object/actor_mixer/mod.rs:35-47 | rpfm_lib/src/files/sound_bank/sections/hirc/object/audio_bus/mod.rs:35-47 — `rpfm_lib/src/files/sound_bank/sections/hirc/object/actor_mixer/mod.rs` and `rpfm_lib/src/files/sound_bank/sections/hirc/object/audio_bus/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 13 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13 lines × 2) rpfm_ui/src/views/table/slots.rs:538 — rpfm_ui/src/views/table/slots.rs:538-552 | rpfm_ui/src/views/table/slots.rs:636-648 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/slots.rs:538` 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.
D1 · Cyclomatic Complexity · AppUI · ×11
  • AppUI::open_packedfile (cyclomatic 99) rpfm_ui/src/app_ui/mod.rs:2019 — AppUI::open_packedfile has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AppUI::new_file_dialog (cyclomatic 32) rpfm_ui/src/app_ui/mod.rs:3103 — AppUI::new_file_dialog 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.
  • AppUI::build_open_mymod_submenus (cyclomatic 27) rpfm_ui/src/app_ui/mod.rs:1921 — AppUI::build_open_mymod_submenus has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AppUI::update_views_names (cyclomatic 26) rpfm_ui/src/app_ui/mod.rs:3866 — AppUI::update_views_names 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.
  • AppUI::build_pack_submenus (cyclomatic 24) rpfm_ui/src/app_ui/mod.rs:1700 — AppUI::build_pack_submenus 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.
  • AppUI::new_queek_packed_file (cyclomatic 23) rpfm_ui/src/app_ui/mod.rs:2984 — AppUI::new_queek_packed_file 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.
  • AppUI::change_game_selected (cyclomatic 22) rpfm_ui/src/app_ui/mod.rs:4053 — AppUI::change_game_selected 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.
  • AppUI::open_special_view (cyclomatic 19) rpfm_ui/src/app_ui/mod.rs:2762 — AppUI::open_special_view has cyclomatic complexity 19 (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.
  • AppUI::open_packfile (cyclomatic 18) rpfm_ui/src/app_ui/mod.rs:1289 — AppUI::open_packfile 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.
  • AppUI::build_starpos (cyclomatic 18) rpfm_ui/src/app_ui/mod.rs:4363 — AppUI::build_starpos has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AppUI::save_packfile_by_key (cyclomatic 17) rpfm_ui/src/app_ui/mod.rs:1457 — AppUI::save_packfile_by_key has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableView · ×11
  • TableView::set_data_on_cells (cyclomatic 45) rpfm_ui/src/views/table/mod.rs:2960 — TableView::set_data_on_cells has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TableView::paste_as_it_fits (cyclomatic 32) rpfm_ui/src/views/table/mod.rs:2188 — TableView::paste_as_it_fits has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • TableView::patch_column (cyclomatic 30) rpfm_ui/src/views/table/mod.rs:3519 — TableView::patch_column has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TableView::new_view (cyclomatic 29) rpfm_ui/src/views/table/mod.rs:398 — TableView::new_view 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.
  • TableView::go_to_file (cyclomatic 26) rpfm_ui/src/views/table/mod.rs:3892 — TableView::go_to_file 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.
  • TableView::process_edition (cyclomatic 25) rpfm_ui/src/views/table/mod.rs:3177 — TableView::process_edition 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.
  • TableView::go_to_definition (cyclomatic 23) rpfm_ui/src/views/table/mod.rs:3766 — TableView::go_to_definition 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.
  • TableView::go_to_loc (cyclomatic 20) rpfm_ui/src/views/table/mod.rs:4020 — TableView::go_to_loc 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.
  • TableView::undo_redo (cyclomatic 19) rpfm_ui/src/views/table/mod.rs:2306 — TableView::undo_redo has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TableView::get_indexes_as_lua_table (cyclomatic 18) rpfm_ui/src/views/table/mod.rs:2484 — TableView::get_indexes_as_lua_table 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.
  • TableView::smart_delete (cyclomatic 17) rpfm_ui/src/views/table/mod.rs:2870 — TableView::smart_delete has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · rpfm_ui · ×11
  • rpfm_ui::views::table::utils::build_columns (cyclomatic 43) rpfm_ui/src/views/table/utils.rs:745 — rpfm_ui::views::table::utils::build_columns has cyclomatic complexity 43 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rpfm_ui::views::table::utils::load_data (cyclomatic 40) rpfm_ui/src/views/table/utils.rs:416 — rpfm_ui::views::table::utils::load_data has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_ui::app_ui::slots::handle_tab_current_changed (cyclomatic 31) rpfm_ui/src/app_ui/slots.rs:243 — rpfm_ui::app_ui::slots::handle_tab_current_changed has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_ui::views::table::utils::setup_item_delegates (cyclomatic 31) rpfm_ui/src/views/table/utils.rs:1117 — rpfm_ui::views::table::utils::setup_item_delegates has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rpfm_ui::tools::ceo_builder::build_ceo_builder (cyclomatic 26) rpfm_ui/src/tools/ceo_builder/mod.rs:126 — rpfm_ui::tools::ceo_builder::build_ceo_builder 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.
  • rpfm_ui::communications::websocket_loop (cyclomatic 25) rpfm_ui/src/communications/mod.rs:385 — rpfm_ui::communications::websocket_loop 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.
  • rpfm_ui::pack_tree::sort_item_in_tree_view (cyclomatic 25) rpfm_ui/src/pack_tree/mod.rs:1945 — rpfm_ui::pack_tree::sort_item_in_tree_view 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.
  • rpfm_ui::views::table::utils::get_default_item_from_field (cyclomatic 20) rpfm_ui/src/views/table/utils.rs:239 — rpfm_ui::views::table::utils::get_default_item_from_field 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.
  • rpfm_ui::packedfile_views::esf::esftree::get_node_type_from_tree_node (cyclomatic 19) rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:226 — rpfm_ui::packedfile_views::esf::esftree::get_node_type_from_tree_node has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_ui::views::table::filter::parse_predicate (cyclomatic 19) rpfm_ui/src/views/table/filter/mod.rs:308 — rpfm_ui::views::table::filter::parse_predicate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_ui::app_ui::slots::handle_tab_unpreview (cyclomatic 17) rpfm_ui/src/app_ui/slots.rs:400 — rpfm_ui::app_ui::slots::handle_tab_unpreview 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×11
  • Duplicated block (14 lines × 2) rpfm_extensions/src/dependencies/mod.rs:3573 — rpfm_extensions/src/dependencies/mod.rs:3573-3586 | rpfm_extensions/src/dependencies/mod.rs:3608-3621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_extensions/src/dependencies/mod.rs:3589` calls `key` and `rpfm_extensions/src/dependencies/mod.rs:3623` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) rpfm_extensions/src/diagnostics/table.rs:586 — rpfm_extensions/src/diagnostics/table.rs:586-599 | rpfm_extensions/src/diagnostics/table.rs:733-746 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/diagnostics/table.rs:586` 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) rpfm_lib/src/games/supported_games.rs:2377 — rpfm_lib/src/games/supported_games.rs:2377-2390 | rpfm_lib/src/games/supported_games.rs:2585-2598 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:2377` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) rpfm_lib/src/integrations/assembly_kit/mod.rs:445 — rpfm_lib/src/integrations/assembly_kit/mod.rs:445-458 | rpfm_lib/src/integrations/assembly_kit/mod.rs:497-510 — both copies are in the same file, so extract the 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 `rpfm_lib/src/integrations/assembly_kit/mod.rs:445` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) rpfm_server/src/ceo_builder.rs:923 — rpfm_server/src/ceo_builder.rs:923-936 | rpfm_server/src/ceo_builder.rs:1164-1177 — both copies are in the same file, so extract the 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 `rpfm_server/src/ceo_builder.rs:923` 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) rpfm_server/src/ceo_builder.rs:938 — rpfm_server/src/ceo_builder.rs:938-951 | rpfm_server/src/ceo_builder.rs:1179-1192 — both copies are in the same file, so extract the 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 `rpfm_server/src/ceo_builder.rs:938` 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) rpfm_ui/src/packedfile_views/decoder/mod.rs:1134 — rpfm_ui/src/packedfile_views/decoder/mod.rs:1134-1147 | rpfm_ui/src/packedfile_views/decoder/mod.rs:1257-1270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rpfm_lib/src/files/bmd/battlefield_building_list/mod.rs:118 — rpfm_lib/src/files/bmd/battlefield_building_list/mod.rs:118-131 | rpfm_lib/src/files/bmd/prefab_instance_list/mod.rs:87-100 — 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 `rpfm_lib/src/files/bmd/battlefield_building_list/mod.rs: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.
  • Duplicated block (14 lines × 2) rpfm_extensions/src/merge/mod.rs:123 — rpfm_extensions/src/merge/mod.rs:123-136 | rpfm_extensions/src/merge/mod.rs:155-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `baseline` to `Option<&DB>` in one and `Option<&Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_extensions/src/merge/mod.rs:120` calls `patches`, `clone`, `table_name` and `rpfm_extensions/src/merge/mod.rs:153` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) rpfm_lib/src/files/audio/mod.rs:105 — rpfm_lib/src/files/audio/mod.rs:105-118 | rpfm_lib/src/files/unknown/mod.rs:78-91 — 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 `rpfm_lib/src/files/audio/mod.rs:105` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) rpfm_lib/src/files/table/mod.rs:730 — rpfm_lib/src/files/table/mod.rs:730-743 | rpfm_lib/src/files/table/mod.rs:970-983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · Pack · ×10
  • Pack::optimize (cyclomatic 65) rpfm_extensions/src/optimizer/mod.rs:299 — Pack::optimize has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Pack::write_pfh3 (cyclomatic 24) rpfm_lib/src/files/pack/pack_versions/pfh3.rs:98 — Pack::write_pfh3 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.
  • Pack::write_pfh6 (cyclomatic 23) rpfm_lib/src/files/pack/pack_versions/pfh6.rs:128 — Pack::write_pfh6 has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Pack::read (cyclomatic 22) rpfm_lib/src/files/pack/mod.rs:589 — Pack::read has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Pack::generate_missing_loc_data (cyclomatic 22) rpfm_lib/src/files/pack/mod.rs:1194 — Pack::generate_missing_loc_data 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.
  • Pack::write_pfh5 (cyclomatic 21) rpfm_lib/src/files/pack/pack_versions/pfh5.rs:129 — Pack::write_pfh5 has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Pack::update_anim_ids (cyclomatic 19) rpfm_lib/src/files/pack/mod.rs:1469 — Pack::update_anim_ids has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Pack::patch_siege_ai (cyclomatic 17) rpfm_lib/src/files/pack/mod.rs:1317 — Pack::patch_siege_ai 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.
  • Pack::write_pfh4 (cyclomatic 16) rpfm_lib/src/files/pack/pack_versions/pfh4.rs:109 — Pack::write_pfh4 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.
  • Pack::read_pfh5 (cyclomatic 16) rpfm_lib/src/files/pack/pack_versions/pfh5.rs:27 — Pack::read_pfh5 has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Cs2Parsed · ×10
  • Cs2Parsed::read_v12 (cyclomatic 20) rpfm_lib/src/files/cs2_parsed/versions/v12.rs:22 — Cs2Parsed::read_v12 has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v12) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v12 (cyclomatic 20) rpfm_lib/src/files/cs2_parsed/versions/v12.rs:202 — Cs2Parsed::write_v12 has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v12) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v13 (cyclomatic 20) rpfm_lib/src/files/cs2_parsed/versions/v13.rs:22 — Cs2Parsed::read_v13 has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v13) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v13 (cyclomatic 20) rpfm_lib/src/files/cs2_parsed/versions/v13.rs:202 — Cs2Parsed::write_v13 has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v13) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v20 (cyclomatic 19) rpfm_lib/src/files/cs2_parsed/versions/v20.rs:22 — Cs2Parsed::read_v20 has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v20) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v20 (cyclomatic 19) rpfm_lib/src/files/cs2_parsed/versions/v20.rs:186 — Cs2Parsed::write_v20 has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v20) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v21 (cyclomatic 19) rpfm_lib/src/files/cs2_parsed/versions/v21.rs:22 — Cs2Parsed::read_v21 has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v21) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v21 (cyclomatic 19) rpfm_lib/src/files/cs2_parsed/versions/v21.rs:188 — Cs2Parsed::write_v21 has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v21) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::read_v18 (cyclomatic 17) rpfm_lib/src/files/cs2_parsed/versions/v18.rs:22 — Cs2Parsed::read_v18 has cyclomatic 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. This shape REPEATS in the file: one other method here (Cs2Parsed::write_v18) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Cs2Parsed::write_v18 (cyclomatic 17) rpfm_lib/src/files/cs2_parsed/versions/v18.rs:179 — Cs2Parsed::write_v18 has cyclomatic 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. This shape REPEATS in the file: one other method here (Cs2Parsed::read_v18) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) rpfm_extensions/src/dependencies/mod.rs:417 — rpfm_extensions/src/dependencies/mod.rs:417-431 | rpfm_extensions/src/dependencies/mod.rs:823-837 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:417` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1364 — rpfm_extensions/src/dependencies/mod.rs:1364-1378 | rpfm_extensions/src/dependencies/mod.rs:1550-1564 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1364` 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) rpfm_lib/src/files/pack/mod.rs:1246 — rpfm_lib/src/files/pack/mod.rs:1246-1260 | rpfm_lib/src/files/pack/mod.rs:1271-1285 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/pack/mod.rs:1246` 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) rpfm_lib/src/games/mod.rs:1479 — rpfm_lib/src/games/mod.rs:1479-1493 | rpfm_lib/src/games/mod.rs:1533-1547 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/mod.rs:1479` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rpfm_server/src/ceo_builder.rs:434 — rpfm_server/src/ceo_builder.rs:434-448 | rpfm_server/src/ceo_builder.rs:606-620 — both copies are in the same file, so extract the 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 `rpfm_server/src/ceo_builder.rs:434` 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) rpfm_ui/src/app_ui/slots.rs:1244 — rpfm_ui/src/app_ui/slots.rs:1244-1258 | rpfm_ui/src/app_ui/slots.rs:1264-1278 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/slots.rs:1244` 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) rpfm_ui/src/global_search_ui/mod.rs:1265 — rpfm_ui/src/global_search_ui/mod.rs:1265-1279 | rpfm_ui/src/global_search_ui/mod.rs:1475-1490 — both copies are in the same file, so extract the 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 `rpfm_ui/src/global_search_ui/mod.rs:1265` 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) rpfm_ui/src/tools/unit_editor/mod.rs:758 — rpfm_ui/src/tools/unit_editor/mod.rs:758-772 | rpfm_ui/src/tools/unit_editor/mod.rs:779-793 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/unit_editor/mod.rs:758` 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) rpfm_ui/src/ui/mod.rs:371 — rpfm_ui/src/ui/mod.rs:371-385 | rpfm_ui/src/welcome_page_ui/mod.rs:260-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) rpfm_extensions/src/search/mod.rs:422 — rpfm_extensions/src/search/mod.rs:422-436 | rpfm_extensions/src/search/mod.rs:599-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.
D1 · Cyclomatic Complexity · Dependencies · ×9
  • Dependencies::generate_automatic_patches (cyclomatic 135) rpfm_extensions/src/dependencies/mod.rs:2584 — Dependencies::generate_automatic_patches has cyclomatic complexity 135 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::build_starpos_post (cyclomatic 57) rpfm_extensions/src/dependencies/mod.rs:3376 — Dependencies::build_starpos_post 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.
  • Dependencies::bruteforce_loc_key_order (cyclomatic 49) rpfm_extensions/src/dependencies/mod.rs:2334 — Dependencies::bruteforce_loc_key_order has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::build_starpos_pre (cyclomatic 46) rpfm_extensions/src/dependencies/mod.rs:3074 — Dependencies::build_starpos_pre 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.
  • Dependencies::db_reference_data_generic (cyclomatic 36) rpfm_extensions/src/dependencies/mod.rs:1740 — Dependencies::db_reference_data_generic has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::generate_references (cyclomatic 19) rpfm_extensions/src/dependencies/mod.rs:581 — Dependencies::generate_references has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::db_and_loc_data (cyclomatic 19) rpfm_extensions/src/dependencies/mod.rs:1498 — Dependencies::db_and_loc_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::db_reference_data (cyclomatic 19) rpfm_extensions/src/dependencies/mod.rs:1577 — Dependencies::db_reference_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dependencies::db_data_datacored (cyclomatic 16) rpfm_extensions/src/dependencies/mod.rs:1437 — Dependencies::db_data_datacored 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.
D2 · Cognitive Complexity · SessionState · ×9
  • SessionState::import_dependencies (cognitive 39) rpfm_server/src/state/files.rs:789 — SessionState::import_dependencies has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 7 (26 pts), loops 4 (9 pts), if/else 2 (4 pts) (nesting depth added 26). 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.
  • SessionState::paste_files (cognitive 22) rpfm_server/src/state/files.rs:466 — SessionState::paste_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionState::extract_files (cognitive 21) rpfm_server/src/state/files.rs:576 — SessionState::extract_files has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (6 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionState::anim_paths_by_skeleton (cognitive 20) rpfm_server/src/state/files.rs:753 — SessionState::anim_paths_by_skeleton has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionState::update_schema_from_asskit (cognitive 19) rpfm_server/src/state/schema.rs:40 — SessionState::update_schema_from_asskit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • SessionState::find_definition (cognitive 19) rpfm_server/src/state/tables.rs:281 — SessionState::find_definition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionState::search_references (cognitive 17) rpfm_server/src/state/tables.rs:412 — SessionState::search_references has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (8 pts) (nesting depth added 9). 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.
  • SessionState::set_game_selected (cognitive 16) rpfm_server/src/state/dependencies.rs:46 — SessionState::set_game_selected has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionState::missing_definitions (cognitive 16) rpfm_server/src/state/packs.rs:515 — SessionState::missing_definitions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D3 · God Classes · FunctionTooLong · ×9
  • FunctionTooLong: rpfm_server::ceo_builder::build_ceo_entries rpfm_server/src/ceo_builder.rs:25 — FunctionTooLong — rpfm_server::ceo_builder::build_ceo_entries runs 949 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 849 over it, 9.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_extensions::gltf::gltf_from_rigid rpfm_extensions/src/gltf/mod.rs:109 — FunctionTooLong — rpfm_extensions::gltf::gltf_from_rigid runs 265 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_server::api::dispatch rpfm_server/src/api.rs:163 — FunctionTooLong — rpfm_server::api::dispatch runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_ui::tools::ceo_builder::build_ceo_builder rpfm_ui/src/tools/ceo_builder/mod.rs:126 — FunctionTooLong — rpfm_ui::tools::ceo_builder::build_ceo_builder runs 190 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_ui::views::table::utils::get_default_item_from_field rpfm_ui/src/views/table/utils.rs:239 — FunctionTooLong — rpfm_ui::views::table::utils::get_default_item_from_field runs 122 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_ui::views::table::utils::load_data rpfm_ui/src/views/table/utils.rs:416 — FunctionTooLong — rpfm_ui::views::table::utils::load_data runs 120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_lib::files::table::encode_table rpfm_lib/src/files/table/mod.rs:1542 — FunctionTooLong — rpfm_lib::files::table::encode_table runs 117 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_ui::views::table::utils::build_columns rpfm_ui/src/views/table/utils.rs:745 — FunctionTooLong — rpfm_ui::views::table::utils::build_columns runs 117 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files rpfm_lib/src/integrations/assembly_kit/mod.rs:215 — FunctionTooLong — rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files runs 109 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×9
  • Edited copy of a member (11 corresponding lines) rpfm_telemetry/src/logger.rs:482 — rpfm_telemetry/src/logger.rs:482-492 | rpfm_telemetry/src/logger.rs:503-513 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_ui/src/tools/faction_painter/mod.rs:555 — rpfm_ui/src/tools/faction_painter/mod.rs:555-565 | rpfm_ui/src/tools/unit_editor/mod.rs:702-712 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_ui_common/src/locale.rs:123 — rpfm_ui_common/src/locale.rs:123-133 | rpfm_ui_common/src/locale.rs:136-146 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:379 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:379-389 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:392-402 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:68 — rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:68-79 | rpfm_lib/src/files/bmd_vegetation/tree_list/mod.rs:196-206 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_lib/src/files/bmd/battlefield_building_list/building/mod.rs:58 — rpfm_lib/src/files/bmd/battlefield_building_list/building/mod.rs:58-71 | rpfm_lib/src/files/bmd/prefab_instance_list/prefab_instance/property_override/mod.rs:54-64 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_lib/src/files/bmd_vegetation/tree_list/mod.rs:180 — rpfm_lib/src/files/bmd_vegetation/tree_list/mod.rs:180-191 | rpfm_lib/src/files/tile_database/texture/mod.rs:72-82 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_lib/src/schema/mod.rs:2283 — rpfm_lib/src/schema/mod.rs:2283-2293 | rpfm_lib/src/schema/mod.rs:2307-2322 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) rpfm_extensions/src/search/text.rs:137 — rpfm_extensions/src/search/text.rs:137-147 | rpfm_extensions/src/search/unknown.rs:97-107 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · GroupFormations · ×8
  • GroupFormations::decode_rom_2 (cognitive 24) rpfm_lib/src/files/group_formations/versions/rome_2.rs:19 — GroupFormations::decode_rom_2 has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (21 pts), match/switch 1 (3 pts) (nesting depth added 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.
  • GroupFormations::encode_rom_2 (cognitive 24) rpfm_lib/src/files/group_formations/versions/rome_2.rs:119 — GroupFormations::encode_rom_2 has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (21 pts), match/switch 1 (3 pts) (nesting depth added 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.
  • GroupFormations::decode_wh3 (cognitive 24) rpfm_lib/src/files/group_formations/versions/warhammer_3.rs:19 — GroupFormations::decode_wh3 has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (21 pts), match/switch 1 (3 pts) (nesting depth added 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.
  • GroupFormations::encode_wh3 (cognitive 24) rpfm_lib/src/files/group_formations/versions/warhammer_3.rs:124 — GroupFormations::encode_wh3 has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (21 pts), match/switch 1 (3 pts) (nesting depth added 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.
  • GroupFormations::decode_sho_2 (cognitive 22) rpfm_lib/src/files/group_formations/versions/shogun_2.rs:19 — GroupFormations::decode_sho_2 has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 1 (3 pts) (nesting depth added 14). 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.
  • GroupFormations::encode_sho_2 (cognitive 22) rpfm_lib/src/files/group_formations/versions/shogun_2.rs:114 — GroupFormations::encode_sho_2 has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 1 (3 pts) (nesting depth added 14). 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.
  • GroupFormations::decode_troy (cognitive 22) rpfm_lib/src/files/group_formations/versions/troy.rs:19 — GroupFormations::decode_troy has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 1 (3 pts) (nesting depth added 14). 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.
  • GroupFormations::encode_troy (cognitive 22) rpfm_lib/src/files/group_formations/versions/troy.rs:127 — GroupFormations::encode_troy has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 1 (3 pts) (nesting depth added 14). 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_extensions/src/dependencies/mod.rs:407 — rpfm_extensions/src/dependencies/mod.rs:407-484 | rpfm_extensions/src/dependencies/mod.rs:792-897 | rpfm_extensions/src/dependencies/mod.rs:901-989 | rpfm_lib/src/files/mod.rs:1799-1822 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_extensions/src/dependencies/mod.rs:492 — rpfm_extensions/src/dependencies/mod.rs:492-550 | rpfm_extensions/src/dependencies/mod.rs:672-748 | rpfm_extensions/src/dependencies/mod.rs:792-897 | rpfm_extensions/src/dependencies/mod.rs:901-989 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:43 — rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:43-53 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/toggleable_building_slot/building_link/mod.rs:42-52 | rpfm_lib/src/files/tile_database/climate/mod.rs:68-78 | rpfm_lib/src/files/tile_database/tile/mod.rs:93-103 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_lib/src/files/bmd/mod.rs:454 — rpfm_lib/src/files/bmd/mod.rs:454-477 | rpfm_lib/src/files/bmd_vegetation/mod.rs:168-186 | rpfm_lib/src/files/hlsl_compiled/mod.rs:140-158 | rpfm_lib/src/files/tile_database/mod.rs:111-129 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_ui/src/app_ui/mod.rs:3305 — rpfm_ui/src/app_ui/mod.rs:3305-3340 | rpfm_ui/src/app_ui/mod.rs:3343-3390 | rpfm_ui/src/views/table/mod.rs:2766-2797 | rpfm_ui/src/views/table/mod.rs:2800-2843 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_ui/src/ffi/mod.rs:804 — rpfm_ui/src/ffi/mod.rs:804-861 | rpfm_ui/src/tools/translator/mod.rs:301-802 | rpfm_ui/src/tools/translator/mod.rs:1864-1955 | rpfm_ui/src/views/table/utils.rs:1372-1430 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:941 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:941-959 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:964-982 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:429-450 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:455-476 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1010 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1010-1028 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1033-1051 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:487-505 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:510-529 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×8
  • Duplicated block (8 lines × 3) rpfm_extensions/src/dependencies/mod.rs:1251 — rpfm_extensions/src/dependencies/mod.rs:1251-1258 | rpfm_extensions/src/dependencies/mod.rs:1262-1269 | rpfm_extensions/src/dependencies/mod.rs:1282-1289 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:1251` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rpfm_extensions/src/optimizer/mod.rs:569 — rpfm_extensions/src/optimizer/mod.rs:569-576 | rpfm_extensions/src/optimizer/mod.rs:583-590 | rpfm_extensions/src/optimizer/mod.rs:594-601 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/optimizer/mod.rs:569` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rpfm_lib/src/games/supported_games.rs:398 — rpfm_lib/src/games/supported_games.rs:398-405 | rpfm_lib/src/games/supported_games.rs:595-603 | rpfm_lib/src/games/supported_games.rs:808-815 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rpfm_ui/src/app_ui/mod.rs:1144 — rpfm_ui/src/app_ui/mod.rs:1144-1151 | rpfm_ui/src/app_ui/mod.rs:1184-1191 | rpfm_ui/src/app_ui/mod.rs:1241-1248 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rpfm_ui/src/packedfile_views/bmd/slots.rs:49 — rpfm_ui/src/packedfile_views/bmd/slots.rs:49-56 | rpfm_ui/src/packedfile_views/text/slots.rs:54-61 | rpfm_ui/src/packedfile_views/vmd/slots.rs:52-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/bmd/slots.rs:49` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&Arc<FileBMDView>` in one and `&Arc<PackedFileTextView>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:425 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:425-432 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:505-512 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:585-592 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rpfm_ui/src/app_ui/slots.rs:1628 — rpfm_ui/src/app_ui/slots.rs:1628-1635 | rpfm_ui/src/app_ui/slots.rs:1647-1654 | rpfm_ui/src/app_ui/slots.rs:1665-1672 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1628` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:62 — rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:62-69 | rpfm_lib/src/files/bmd/playable_area/mod.rs:63-70 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/terrain_stencil_triangle/mod.rs:62-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×8
  • Low cohesion: Tool (LCOM4 15) rpfm_ui/src/tools/mod.rs:139 — Tool's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ToolUnitEditor (LCOM4 10) rpfm_ui/src/tools/unit_editor/mod.rs:140 — ToolUnitEditor's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ToolFactionPainter (LCOM4 6) rpfm_ui/src/tools/faction_painter/mod.rs:95 — ToolFactionPainter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PackTranslation (LCOM4 5) rpfm_extensions/src/translator/mod.rs:147 — PackTranslation's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AnimFragmentBattle (LCOM4 4) rpfm_lib/src/files/anim_fragment_battle/mod.rs:130 — AnimFragmentBattle's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TreeListReferenceList (LCOM4 4) rpfm_lib/src/files/bmd/tree_list_reference_list/mod.rs:29 — TreeListReferenceList's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PortraitSettings (LCOM4 4) rpfm_lib/src/files/portrait_settings/mod.rs:54 — PortraitSettings's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Schema (LCOM4 4) rpfm_lib/src/schema/mod.rs:211 — Schema's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D2 · Cognitive Complexity · rpfm_lib · ×7
  • rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files (cognitive 153) rpfm_lib/src/integrations/assembly_kit/mod.rs:215 — rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files has cognitive complexity 153 (threshold 15). Drivers by points: if/else 27 (129 pts), loops 4 (18 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 118). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rpfm_lib::files::table::encode_table (cognitive 122) rpfm_lib/src/files/table/mod.rs:1542 — rpfm_lib::files::table::encode_table has cognitive complexity 122 (threshold 15). Drivers by points: if/else 26 (67 pts), match/switch 9 (45 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_lib::files::table::decode_field (cognitive 44) rpfm_lib/src/files/table/mod.rs:1259 — rpfm_lib::files::table::decode_field has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (39 pts), match/switch 3 (5 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rpfm_lib::files::table::decode_field_postprocess (cognitive 26) rpfm_lib/src/files/table/mod.rs:1424 — rpfm_lib::files::table::decode_field_postprocess has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 7 (10 pts), loops 1 (3 pts) (nesting depth added 13). 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.
  • rpfm_lib::integrations::assembly_kit::get_raw_data_paths (cognitive 19) rpfm_lib/src/integrations/assembly_kit/mod.rs:478 — rpfm_lib::integrations::assembly_kit::get_raw_data_paths has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). 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.
  • rpfm_lib::utils::final_folders_from_subdir (cognitive 18) rpfm_lib/src/utils.rs:286 — rpfm_lib::utils::final_folders_from_subdir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). 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.
  • rpfm_lib::utils::files_from_subdir (cognitive 16) rpfm_lib/src/utils.rs:211 — rpfm_lib::utils::files_from_subdir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: connections.rs ↔ tips.rs rpfm_ui/src/app_ui/connections.rs:1 — `rpfm_ui/src/app_ui/connections.rs` and `rpfm_ui/src/app_ui/tips.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `ca568891` Implemented Import/Export All Open MyMod Actions.; `4432e81e` Make MyMod system multi-pack aware.; `53463625` Implemented Save PackFile for Release. — run `git show` on any of them.
  • Change coupling: mod.rs ↔ slots.rs rpfm_ui/src/packedfile_views/mod.rs:1 — `rpfm_ui/src/packedfile_views/mod.rs` and `rpfm_ui/src/packedfile_views/rigidmodel/slots.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `af2b324b` Migrated UI to use the new WIP rigidmodel editor.; `e414371f` Initial implementation of a RigidModel View, by Phazer.; `2daca1d1` Fixed a bug that caused certain crashes when renaming items in the tr… — run `git show` on any of them.
  • Change coupling: mod.rs ↔ slots.rs rpfm_ui/src/packedfile_views/table/mod.rs:1 — `rpfm_ui/src/packedfile_views/table/mod.rs` and `rpfm_ui/src/packedfile_views/text/slots.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `726ea67c` Fix modified file markings not respecting the pack the files are in.; `2daca1d1` Fixed a bug that caused certain crashes when renaming items in the tr…; `4a03bf35` Implemented the `Is Modified` feature. — run `git show` on any of them.
  • Change coupling: reader.rs ↔ writer.rs rpfm_lib/src/binary/reader.rs:1 — `rpfm_lib/src/binary/reader.rs` and `rpfm_lib/src/binary/writer.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `13c0144b` Fixed ESF 24-bit integers being read and written as little-endian.; `82fbcdd1` Added some more binary helpers.; `2989ad55` Added additional readers and writers. — run `git show` on any of them.
  • Change coupling: mod.rs ↔ slots.rs rpfm_ui/src/communications/mod.rs:1 — `rpfm_ui/src/communications/mod.rs` and `rpfm_ui/src/packedfile_views/rigidmodel/slots.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f5d01420` Expanded ui, and added some limited texture support for the gltf expo…; `af2b324b` Migrated UI to use the new WIP rigidmodel editor.; `ac145f2c` Fix warnings. — run `git show` on any of them.
  • Change coupling: mod.rs ↔ slots.rs rpfm_ui/src/packedfile_views/mod.rs:1 — `rpfm_ui/src/packedfile_views/mod.rs` and `rpfm_ui/src/packedfile_views/packfile/slots.rs` change together 52% of the time (14 of the 27 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `95f3bfd6` Re-implemented add from pack.; `75e04418` Replaced "Add from Pack" feature with a "Copy to Pack" feature using …; `ace88fc9` Initial implementation for Copy/Cut/Paste/Duplicate operations. — run `git show` on any of them.
  • Change coupling: connections.rs ↔ mod.rs rpfm_ui/src/app_ui/connections.rs:1 — `rpfm_ui/src/app_ui/connections.rs` and `rpfm_ui/src/welcome_page_ui/mod.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `5674df9b` Implemented split view.; `032253ef` Fixed old re-entrancy CTD on open packs.; `f48b4396` Implemented user feedback dialog. — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) rpfm_extensions/src/lua/harness/mod.rs:436 — rpfm_extensions/src/lua/harness/mod.rs:436-448 | rpfm_extensions/src/lua/harness/mod.rs:451-462 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_extensions/src/startpos/world/agents.rs:57 — rpfm_extensions/src/startpos/world/agents.rs:57-68 | rpfm_extensions/src/startpos/world/agents.rs:81-92 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_lib/src/files/sound_bank_database/mod.rs:519 — rpfm_lib/src/files/sound_bank_database/mod.rs:519-530 | rpfm_lib/src/files/sound_events/mod.rs:360-371 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:70 — rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:70-81 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/mod.rs:60-71 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_lib/src/files/bmd/battlefield_building_list/building/mod.rs:76 — rpfm_lib/src/files/bmd/battlefield_building_list/building/mod.rs:76-87 | rpfm_lib/src/files/bmd/prefab_instance_list/prefab_instance/mod.rs:67-78 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_ui/src/packedfile_views/group_formations/slots.rs:713 — rpfm_ui/src/packedfile_views/group_formations/slots.rs:713-724 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:727-738 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) rpfm_server/src/state/files.rs:332 — rpfm_server/src/state/files.rs:332-343 | rpfm_server/src/state/files.rs:705-717 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×7
  • Edited copy of a member (8 corresponding lines) rpfm_extensions/src/startpos/cai/settlements.rs:51 — rpfm_extensions/src/startpos/cai/settlements.rs:51-58 | rpfm_extensions/src/startpos/cai/settlements.rs:67-74 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_lib/src/files/fastbin_lists/mod.rs:132 — rpfm_lib/src/files/fastbin_lists/mod.rs:132-139 | rpfm_lib/src/files/fastbin_lists/mod.rs:153-160 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_extensions/src/startpos/writer/header.rs:95 — rpfm_extensions/src/startpos/writer/header.rs:95-102 | rpfm_extensions/src/startpos/writer/preopen.rs:82-89 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_lib/src/files/mod.rs:1451 — rpfm_lib/src/files/mod.rs:1451-1458 | rpfm_lib/src/files/mod.rs:1470-1477 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_extensions/src/startpos/esf_nav.rs:47 — rpfm_extensions/src/startpos/esf_nav.rs:47-54 | rpfm_extensions/src/startpos/layout.rs:797-804 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_server/src/state/search.rs:421 — rpfm_server/src/state/search.rs:421-428 | rpfm_ui/src/global_search_ui/mod.rs:2389-2396 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rpfm_lib/src/files/asset_variation_db/v1.rs:114 — rpfm_lib/src/files/asset_variation_db/v1.rs:114-121 | rpfm_lib/src/files/fastbin_lists/mod.rs:183-190 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×7
  • Duplicated block (6 lines × 3) rpfm_extensions/src/dependencies/mod.rs:681 — rpfm_extensions/src/dependencies/mod.rs:681-686 | rpfm_extensions/src/dependencies/mod.rs:692-697 | rpfm_extensions/src/dependencies/mod.rs:703-708 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:681` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:44 — rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:44-49 | rpfm_lib/src/files/bmd/playable_area/mod.rs:45-50 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/terrain_stencil_triangle/mod.rs:44-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_lib/src/files/db/mod.rs:1217 — rpfm_lib/src/files/db/mod.rs:1217-1222 | rpfm_lib/src/files/db/mod.rs:1229-1234 | rpfm_lib/src/files/db/mod.rs:1241-1246 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:1217` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_ui/src/app_ui/mod.rs:3373 — rpfm_ui/src/app_ui/mod.rs:3373-3380 | rpfm_ui/src/views/table/mod.rs:2788-2793 | rpfm_ui/src/views/table/mod.rs:2831-2836 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:3373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_ui/src/diagnostics_ui/mod.rs:1306 — rpfm_ui/src/diagnostics_ui/mod.rs:1306-1311 | rpfm_ui/src/diagnostics_ui/mod.rs:1329-1334 | rpfm_ui/src/global_search_ui/mod.rs:1128-1133 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:1306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_ui/src/tools/faction_painter/mod.rs:304 — rpfm_ui/src/tools/faction_painter/mod.rs:304-309 | rpfm_ui/src/tools/faction_painter/mod.rs:312-317 | rpfm_ui/src/tools/faction_painter/mod.rs:321-326 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rpfm_ui/src/app_ui/mod.rs:1748 — rpfm_ui/src/app_ui/mod.rs:1748-1753 | rpfm_ui/src/app_ui/mod.rs:1772-1777 | rpfm_ui/src/app_ui/mod.rs:1796-1801 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:1748` 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.
D1 · Cyclomatic Complexity · ESF · ×6
  • ESF::read_node (cyclomatic 95) rpfm_lib/src/files/esf/utils.rs:77 — ESF::read_node has cyclomatic complexity 95 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • ESF::save_node (cyclomatic 82) rpfm_lib/src/files/esf/utils.rs:675 — ESF::save_node has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ESF::read_caab (cyclomatic 19) rpfm_lib/src/files/esf/caab.rs:89 — ESF::read_caab has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ESF::save_caab (cyclomatic 17) rpfm_lib/src/files/esf/caab.rs:224 — ESF::save_caab 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.
  • ESF::read_cbab (cyclomatic 17) rpfm_lib/src/files/esf/cbab.rs:85 — ESF::read_cbab 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.
  • ESF::save_cbab (cyclomatic 17) rpfm_lib/src/files/esf/cbab.rs:211 — ESF::save_cbab 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.
D2 · Cognitive Complexity · rpfm_server · ×6
  • rpfm_server::ceo_builder::build_ceo_entries (cognitive 489) rpfm_server/src/ceo_builder.rs:25 — rpfm_server::ceo_builder::build_ceo_entries has cognitive complexity 489 (threshold 15). Drivers by points: if/else 104 (355 pts), loops 36 (123 pts), match/switch 3 (10 pts), boolean chains 1 (nesting depth added 345). Of this number, 458 points are the body's own statements and 31 belong to 4 function items 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.
  • rpfm_server::server_websocket::handle_socket (cognitive 38) rpfm_server/src/server_websocket.rs:108 — rpfm_server::server_websocket::handle_socket has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 5 (14 pts), loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_server::ceo_builder::get_trait_ceos (cognitive 35) rpfm_server/src/ceo_builder.rs:1213 — rpfm_server::ceo_builder::get_trait_ceos has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 5 (13 pts) (nesting depth added 20). Of this number, 29 points are the body's own statements and 6 belong to one function item 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.
  • rpfm_server::ceo_builder::export_ceo_tables (cognitive 26) rpfm_server/src/ceo_builder.rs:1476 — rpfm_server::ceo_builder::export_ceo_tables has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rpfm_server::updater::check_updates_rpfm_with (cognitive 22) rpfm_server/src/updater.rs:217 — rpfm_server::updater::check_updates_rpfm_with has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • rpfm_server::server_mcp::wait_reporting_progress (cognitive 19) rpfm_server/src/server_mcp.rs:153 — rpfm_server::server_mcp::wait_reporting_progress has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolFactionPainter · ×6
  • ToolFactionPainter::get_faction_data (cognitive 110) rpfm_ui/src/tools/faction_painter/mod.rs:590 — ToolFactionPainter::get_faction_data has cognitive complexity 110 (threshold 15). Drivers by points: if/else 20 (59 pts), match/switch 8 (46 pts), loops 2 (5 pts) (nesting depth added 80). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ToolFactionPainter::load_data (cognitive 60) rpfm_ui/src/tools/faction_painter/mod.rs:259 — ToolFactionPainter::load_data has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (57 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ToolFactionPainter::get_faction_banner_data (cognitive 56) rpfm_ui/src/tools/faction_painter/mod.rs:762 — ToolFactionPainter::get_faction_banner_data has cognitive complexity 56 (threshold 15). Drivers by points: if/else 6 (28 pts), match/switch 4 (23 pts), loops 2 (5 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ToolFactionPainter::get_faction_uniform_data) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • ToolFactionPainter::get_faction_uniform_data (cognitive 56) rpfm_ui/src/tools/faction_painter/mod.rs:846 — ToolFactionPainter::get_faction_uniform_data has cognitive complexity 56 (threshold 15). Drivers by points: if/else 6 (28 pts), match/switch 4 (23 pts), loops 2 (5 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ToolFactionPainter::get_faction_banner_data) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • ToolFactionPainter::save_faction_banner_data (cognitive 17) rpfm_ui/src/tools/faction_painter/mod.rs:998 — ToolFactionPainter::save_faction_banner_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ToolFactionPainter::save_faction_uniform_data) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • ToolFactionPainter::save_faction_uniform_data (cognitive 17) rpfm_ui/src/tools/faction_painter/mod.rs:1063 — ToolFactionPainter::save_faction_uniform_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ToolFactionPainter::save_faction_banner_data) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · GlobalSearchUI · ×6
  • GlobalSearchUI::open_match (cognitive 109) rpfm_ui/src/global_search_ui/mod.rs:871 — GlobalSearchUI::open_match has cognitive complexity 109 (threshold 15). Drivers by points: if/else 50 (101 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • GlobalSearchUI::load_rigid_model_matches_to_ui (cognitive 45) rpfm_ui/src/global_search_ui/mod.rs:1556 — GlobalSearchUI::load_rigid_model_matches_to_ui has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (36 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • GlobalSearchUI::load_anim_fragment_battle_matches_to_ui (cognitive 37) rpfm_ui/src/global_search_ui/mod.rs:1193 — GlobalSearchUI::load_anim_fragment_battle_matches_to_ui has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalSearchUI::load_portrait_settings_matches_to_ui (cognitive 36) rpfm_ui/src/global_search_ui/mod.rs:1421 — GlobalSearchUI::load_portrait_settings_matches_to_ui has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalSearchUI::load_unit_variant_matches_to_ui (cognitive 31) rpfm_ui/src/global_search_ui/mod.rs:1864 — GlobalSearchUI::load_unit_variant_matches_to_ui has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalSearchUI::update_pack_sources (cognitive 23) rpfm_ui/src/global_search_ui/mod.rs:679 — GlobalSearchUI::update_pack_sources has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 3, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ESF · ×6
  • ESF::read_node (cognitive 104) rpfm_lib/src/files/esf/utils.rs:77 — ESF::read_node has cognitive complexity 104 (threshold 15). Drivers by points: loops 22 (65 pts), if/else 13 (24 pts), match/switch 6 (12 pts), boolean chains 3 (nesting depth added 60). 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.
  • ESF::save_node (cognitive 84) rpfm_lib/src/files/esf/utils.rs:675 — ESF::save_node has cognitive complexity 84 (threshold 15). Drivers by points: if/else 40 (61 pts), loops 3 (11 pts), boolean chains 7, match/switch 3 (5 pts) (nesting depth added 31). 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.
  • ESF::read_caab (cognitive 58) rpfm_lib/src/files/esf/caab.rs:89 — ESF::read_caab has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (52 pts), boolean chains 3, loops 3 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ESF::read_cbab (cognitive 56) rpfm_lib/src/files/esf/cbab.rs:85 — ESF::read_cbab has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (52 pts), loops 3, boolean chains 1 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ESF::save_caab (cognitive 43) rpfm_lib/src/files/esf/caab.rs:224 — ESF::save_caab has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (10 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ESF::save_cbab (cognitive 43) rpfm_lib/src/files/esf/cbab.rs:211 — ESF::save_cbab has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (10 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×6
  • Duplicated block (9 lines × 3) rpfm_lib/src/files/dat/mod.rs:241 — rpfm_lib/src/files/dat/mod.rs:241-249 | rpfm_lib/src/files/dat/mod.rs:253-261 | rpfm_lib/src/files/dat/mod.rs:265-273 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/dat/mod.rs:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rpfm_ui/src/app_ui/slots.rs:1244 — rpfm_ui/src/app_ui/slots.rs:1244-1252 | rpfm_ui/src/app_ui/slots.rs:1264-1272 | rpfm_ui/src/app_ui/slots.rs:1285-1293 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rpfm_ui/src/packedfile_views/decoder/mod.rs:766 — rpfm_ui/src/packedfile_views/decoder/mod.rs:766-774 | rpfm_ui/src/packedfile_views/decoder/mod.rs:796-804 | rpfm_ui/src/packedfile_views/decoder/mod.rs:832-840 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rpfm_ui/src/tools/faction_painter/mod.rs:678 — rpfm_ui/src/tools/faction_painter/mod.rs:678-686 | rpfm_ui/src/tools/faction_painter/mod.rs:804-812 | rpfm_ui/src/tools/faction_painter/mod.rs:888-896 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:678` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) rpfm_ui/src/tools/translator/slots.rs:99 — rpfm_ui/src/tools/translator/slots.rs:99-107 | rpfm_ui/src/tools/translator/slots.rs:121-129 | rpfm_ui/src/tools/translator/slots.rs:142-150 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/translator/slots.rs:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rpfm_server/src/ceo_builder.rs:523 — rpfm_server/src/ceo_builder.rs:523-531 | rpfm_server/src/ceo_builder.rs:699-707 | rpfm_server/src/ceo_builder.rs:782-790 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/ceo_builder.rs:523` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×6
  • Duplicated block (7 lines × 3) rpfm_extensions/src/search/mod.rs:1154 — rpfm_extensions/src/search/mod.rs:1154-1160 | rpfm_extensions/src/search/mod.rs:1167-1173 | rpfm_extensions/src/search/mod.rs:1180-1186 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/search/mod.rs:1154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:47 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:47-53 | rpfm_lib/src/files/bmd/common/building_link/mod.rs:109-115 | rpfm_lib/src/files/bmd/common/flags/mod.rs:131-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:54` calls `read_v4` and `rpfm_lib/src/files/bmd/common/building_link/mod.rs:116` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:55 — rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:55-61 | rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:54-60 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/mod.rs:44-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:62` calls `read_v8`, `read_v9`, `read_v10` and `rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:61` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) rpfm_ui/src/diagnostics_ui/mod.rs:1701 — rpfm_ui/src/diagnostics_ui/mod.rs:1701-1707 | rpfm_ui/src/diagnostics_ui/mod.rs:1752-1758 | rpfm_ui/src/views/table/mod.rs:4134-4140 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:1701` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/diagnostics_ui/mod.rs:1708` calls `is_null` and `rpfm_ui/src/diagnostics_ui/mod.rs:1760` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) rpfm_ui/src/tools/unit_editor/mod.rs:685 — rpfm_ui/src/tools/unit_editor/mod.rs:685-691 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:656-662 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:728-734 — before extracting anything, compare `rpfm_ui/src/tools/unit_editor/mod.rs` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 261 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:53 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:53-59 | rpfm_lib/src/files/bmd/common/flags/mod.rs:137-143 | rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:57-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:51` calls `read_v1` and `rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:55` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · PackedFileDecoderView · ×5
  • PackedFileDecoderView::import_from_assembly_kit (cyclomatic 84) rpfm_ui/src/packedfile_views/decoder/mod.rs:1325 — PackedFileDecoderView::import_from_assembly_kit 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.
  • PackedFileDecoderView::decode_data_by_fieldtype (cyclomatic 33) rpfm_ui/src/packedfile_views/decoder/mod.rs:993 — PackedFileDecoderView::decode_data_by_fieldtype has cyclomatic complexity 33 (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.
  • PackedFileDecoderView::get_fields_from_view (cyclomatic 28) rpfm_ui/src/packedfile_views/decoder/mod.rs:1207 — PackedFileDecoderView::get_fields_from_view 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.
  • PackedFileDecoderView::update_rows_decoded (cyclomatic 26) rpfm_ui/src/packedfile_views/decoder/mod.rs:1100 — PackedFileDecoderView::update_rows_decoded 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.
  • PackedFileDecoderView::add_field_to_view (cyclomatic 17) rpfm_ui/src/packedfile_views/decoder/mod.rs:857 — PackedFileDecoderView::add_field_to_view has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GlobalSearchUI · ×5
  • GlobalSearchUI::open_match (cyclomatic 58) rpfm_ui/src/global_search_ui/mod.rs:871 — GlobalSearchUI::open_match has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalSearchUI::load_anim_fragment_battle_matches_to_ui (cyclomatic 35) rpfm_ui/src/global_search_ui/mod.rs:1193 — GlobalSearchUI::load_anim_fragment_battle_matches_to_ui has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalSearchUI::load_portrait_settings_matches_to_ui (cyclomatic 27) rpfm_ui/src/global_search_ui/mod.rs:1421 — GlobalSearchUI::load_portrait_settings_matches_to_ui has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalSearchUI::load_rigid_model_matches_to_ui (cyclomatic 27) rpfm_ui/src/global_search_ui/mod.rs:1556 — GlobalSearchUI::load_rigid_model_matches_to_ui has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalSearchUI::load_unit_variant_matches_to_ui (cyclomatic 17) rpfm_ui/src/global_search_ui/mod.rs:1864 — GlobalSearchUI::load_unit_variant_matches_to_ui 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.
D2 · Cognitive Complexity · PackedFileDecoderView · ×5
  • PackedFileDecoderView::import_from_assembly_kit (cognitive 274) rpfm_ui/src/packedfile_views/decoder/mod.rs:1325 — PackedFileDecoderView::import_from_assembly_kit has cognitive complexity 274 (threshold 15). Drivers by points: if/else 84 (240 pts), loops 7 (17 pts), match/switch 4 (16 pts), boolean chains 1 (nesting depth added 178). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • PackedFileDecoderView::get_fields_from_view (cognitive 40) rpfm_ui/src/packedfile_views/decoder/mod.rs:1207 — PackedFileDecoderView::get_fields_from_view has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PackedFileDecoderView::add_field_to_view (cognitive 35) rpfm_ui/src/packedfile_views/decoder/mod.rs:857 — PackedFileDecoderView::add_field_to_view has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (26 pts), loops 2 (5 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 10). 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.
  • PackedFileDecoderView::decode_data_by_fieldtype (cognitive 35) rpfm_ui/src/packedfile_views/decoder/mod.rs:993 — PackedFileDecoderView::decode_data_by_fieldtype has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 17 (31 pts), if/else 2 (4 pts) (nesting depth added 16). 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.
  • PackedFileDecoderView::update_rows_decoded (cognitive 28) rpfm_ui/src/packedfile_views/decoder/mod.rs:1100 — PackedFileDecoderView::update_rows_decoded has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tool · ×5
  • Tool::get_table_data (cognitive 155) rpfm_ui/src/tools/mod.rs:328 — Tool::get_table_data has cognitive complexity 155 (threshold 15). Drivers by points: if/else 15 (80 pts), loops 9 (54 pts), match/switch 3 (20 pts), boolean chains 1 (nesting depth added 127). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Tool::load_definition_to_detailed_view_editor (cognitive 121) rpfm_ui/src/tools/mod.rs:676 — Tool::load_definition_to_detailed_view_editor has cognitive complexity 121 (threshold 15). Drivers by points: if/else 14 (71 pts), match/switch 13 (50 pts) (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Tool::save_table_data (cognitive 63) rpfm_ui/src/tools/mod.rs:476 — Tool::save_table_data has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (46 pts), loops 3 (13 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Tool::get_loc_data (cognitive 31) rpfm_ui/src/tools/mod.rs:566 — Tool::get_loc_data has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (10 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Tool::reload_used_paths (cognitive 20) rpfm_ui/src/tools/mod.rs:278 — Tool::reload_used_paths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RigidModel · ×5
  • RigidModel::search (cognitive 87) rpfm_extensions/src/search/rigid_model.rs:90 — RigidModel::search has cognitive complexity 87 (threshold 15). Drivers by points: loops 22 (82 pts), if/else 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 61). 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.
  • RigidModel::read_v6 (cognitive 22) rpfm_lib/src/files/rigidmodel/versions/v6.rs:26 — RigidModel::read_v6 has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). 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.
  • RigidModel::write_v7 (cognitive 17) rpfm_lib/src/files/rigidmodel/versions/v7.rs:97 — RigidModel::write_v7 has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (7 pts) (nesting depth added 10). 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.
  • RigidModel::write_v8 (cognitive 17) rpfm_lib/src/files/rigidmodel/versions/v8.rs:97 — RigidModel::write_v8 has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (7 pts) (nesting depth added 10). 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.
  • RigidModel::write_v6 (cognitive 16) rpfm_lib/src/files/rigidmodel/versions/v6.rs:119 — RigidModel::write_v6 has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (6 pts), match/switch 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ToolTranslator · ×5
  • ToolTranslator::new (cognitive 70) rpfm_ui/src/tools/translator/mod.rs:294 — ToolTranslator::new has cognitive complexity 70 (threshold 15). Drivers by points: if/else 32 (49 pts), loops 7 (17 pts), boolean chains 3, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolTranslator::change_selected_row (cognitive 51) rpfm_ui/src/tools/translator/mod.rs:980 — ToolTranslator::change_selected_row has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (43 pts), match/switch 4 (8 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ToolTranslator::batch_translate_all (cognitive 34) rpfm_ui/src/tools/translator/mod.rs:1463 — ToolTranslator::batch_translate_all has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolTranslator::import_from_another_pack (cognitive 24) rpfm_ui/src/tools/translator/mod.rs:1401 — ToolTranslator::import_from_another_pack has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ToolTranslator::save_from_detailed_view (cognitive 20) rpfm_ui/src/tools/translator/mod.rs:927 — ToolTranslator::save_from_detailed_view has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×5
  • Edited copy of a member (13 corresponding lines) rpfm_ui/src/tools/faction_painter/connections.rs:25 — rpfm_ui/src/tools/faction_painter/connections.rs:25-37 | rpfm_ui/src/tools/unit_editor/connections.rs:27-43 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:930 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:930-942 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:945-957 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) rpfm_extensions/src/diagnostics/mod.rs:274 — rpfm_extensions/src/diagnostics/mod.rs:274-286 | rpfm_extensions/src/diagnostics/mod.rs:288-300 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:64 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:64-76 | rpfm_lib/src/files/bmd/common/flags/mod.rs:148-160 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:53 — rpfm_lib/src/files/bmd/point_light_list/point_light/mod.rs:53-65 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/mod.rs:43-55 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×5
  • Edited copy of a member (6 corresponding lines) rpfm_lib/src/schema/v4.rs:239 — rpfm_lib/src/schema/v4.rs:239-244 | rpfm_lib/src/schema/v4.rs:446-451 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) rpfm_extensions/src/startpos/layout.rs:342 — rpfm_extensions/src/startpos/layout.rs:342-349 | rpfm_extensions/src/startpos/layout.rs:425-430 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) rpfm_ui/src/packedfile_views/group_formations/mod.rs:1154 — rpfm_ui/src/packedfile_views/group_formations/mod.rs:1154-1159 | rpfm_ui/src/packedfile_views/group_formations/mod.rs:1201-1207 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) rpfm_lib/src/files/tile_database/assembly_kit.rs:134 — rpfm_lib/src/files/tile_database/assembly_kit.rs:134-140 | rpfm_lib/src/files/asset_variation_db/xml.rs:207-212 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) rpfm_lib/src/files/sound_bank/sections/hirc/object/event/mod.rs:35 — rpfm_lib/src/files/sound_bank/sections/hirc/object/event/mod.rs:35-40 | rpfm_lib/src/files/sound_bank/sections/hirc/object/settings/mod.rs:37-42 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · rpfm_server · ×4
  • rpfm_server::ceo_builder::build_ceo_entries (cyclomatic 130) rpfm_server/src/ceo_builder.rs:25 — rpfm_server::ceo_builder::build_ceo_entries has cyclomatic complexity 130 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (rpfm_server::ceo_builder::build_ceo_entries::insert_row) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • rpfm_server::server_websocket::handle_socket (cyclomatic 21) rpfm_server/src/server_websocket.rs:108 — rpfm_server::server_websocket::handle_socket 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.
  • rpfm_server::ceo_builder::build_ceo_entries::insert_row (cyclomatic 18) rpfm_server/src/ceo_builder.rs:87 — rpfm_server::ceo_builder::build_ceo_entries::insert_row has cyclomatic complexity 18 (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. This shape REPEATS in the file: one other method here (rpfm_server::ceo_builder::build_ceo_entries) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • rpfm_server::updater::check_updates_rpfm_with (cyclomatic 17) rpfm_server/src/updater.rs:217 — rpfm_server::updater::check_updates_rpfm_with has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiagnosticsUI · ×4
  • DiagnosticsUI::open_match (cyclomatic 61) rpfm_ui/src/diagnostics_ui/mod.rs:1208 — DiagnosticsUI::open_match has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • DiagnosticsUI::paint_diagnostics_to_view (cyclomatic 51) rpfm_ui/src/diagnostics_ui/mod.rs:1479 — DiagnosticsUI::paint_diagnostics_to_view 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.
  • DiagnosticsUI::load_diagnostics_to_ui (cyclomatic 48) rpfm_ui/src/diagnostics_ui/mod.rs:711 — DiagnosticsUI::load_diagnostics_to_ui has cyclomatic complexity 48 (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.
  • DiagnosticsUI::clean_diagnostics_from_views (cyclomatic 17) rpfm_ui/src/diagnostics_ui/mod.rs:1688 — DiagnosticsUI::clean_diagnostics_from_views has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DiagnosticsUI::update_level_counts (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · rpfm_lib · ×4
  • rpfm_lib::files::table::encode_table (cyclomatic 56) rpfm_lib/src/files/table/mod.rs:1542 — rpfm_lib::files::table::encode_table has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files (cyclomatic 34) rpfm_lib/src/integrations/assembly_kit/mod.rs:215 — rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_lib::files::table::decode_field (cyclomatic 31) rpfm_lib/src/files/table/mod.rs:1259 — rpfm_lib::files::table::decode_field has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rpfm_lib::files::table::decode_field_postprocess (cyclomatic 21) rpfm_lib/src/files/table/mod.rs:1424 — rpfm_lib::files::table::decode_field_postprocess has cyclomatic complexity 21 (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.
D2 · Cognitive Complexity · DiagnosticsUI · ×4
  • DiagnosticsUI::paint_diagnostics_to_view (cognitive 175) rpfm_ui/src/diagnostics_ui/mod.rs:1479 — DiagnosticsUI::paint_diagnostics_to_view has cognitive complexity 175 (threshold 15). Drivers by points: if/else 20 (93 pts), loops 9 (54 pts), match/switch 9 (24 pts), boolean chains 4 (nesting depth added 133). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DiagnosticsUI::open_match (cognitive 172) rpfm_ui/src/diagnostics_ui/mod.rs:1208 — DiagnosticsUI::open_match has cognitive complexity 172 (threshold 15). Drivers by points: if/else 34 (126 pts), loops 4 (21 pts), match/switch 3 (14 pts), boolean chains 11 (nesting depth added 120). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DiagnosticsUI::load_diagnostics_to_ui (cognitive 60) rpfm_ui/src/diagnostics_ui/mod.rs:711 — DiagnosticsUI::load_diagnostics_to_ui has cognitive complexity 60 (threshold 15). Drivers by points: loops 11 (29 pts), match/switch 10 (17 pts), if/else 7 (14 pts) (nesting depth added 32). 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.
  • DiagnosticsUI::clean_diagnostics_from_views (cognitive 51) rpfm_ui/src/diagnostics_ui/mod.rs:1688 — DiagnosticsUI::clean_diagnostics_from_views has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 5 (19 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Container · ×4
  • Container::extract (cognitive 50) rpfm_lib/src/files/mod.rs:914 — Container::extract has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (40 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Container::move_path (cognitive 28) rpfm_lib/src/files/mod.rs:1902 — Container::move_path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 4 (8 pts), loops 1 (3 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Container::insert_folder (cognitive 22) rpfm_lib/src/files/mod.rs:1217 — Container::insert_folder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Container::remove (cognitive 16) rpfm_lib/src/files/mod.rs:1311 — Container::remove has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GameInfo · ×4
  • GameInfo::language_path (cognitive 28) rpfm_lib/src/games/mod.rs:740 — GameInfo::language_path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (28 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GameInfo::ca_packs_paths (cognitive 25) rpfm_lib/src/games/mod.rs:1082 — GameInfo::ca_packs_paths has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (6 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • GameInfo::ca_packs_paths_no_manifest (cognitive 21) rpfm_lib/src/games/mod.rs:1156 — GameInfo::ca_packs_paths_no_manifest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GameInfo::install_type (cognitive 20) rpfm_lib/src/games/mod.rs:576 — GameInfo::install_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×4
  • Edited copy of a member (14 corresponding lines) rpfm_lib/src/files/tile_database/assembly_kit.rs:233 — rpfm_lib/src/files/tile_database/assembly_kit.rs:233-246 | rpfm_lib/src/files/tile_database/assembly_kit.rs:339-352 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:46 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:46-59 | rpfm_lib/src/files/bmd/common/flags/mod.rs:130-143 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) rpfm_lib/src/files/anims_table/mod.rs:270 — rpfm_lib/src/files/anims_table/mod.rs:270-283 | rpfm_lib/src/files/cs2_collision/mod.rs:296-311 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) rpfm_lib/src/binary/reader.rs:1207 — rpfm_lib/src/binary/reader.rs:1207-1220 | rpfm_lib/src/binary/reader.rs:1270-1283 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×4
  • Edited copy of a member (10 corresponding lines) rpfm_extensions/src/startpos/layout.rs:609 — rpfm_extensions/src/startpos/layout.rs:609-618 | rpfm_extensions/src/startpos/layout.rs:625-634 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) rpfm_server/src/state/tables.rs:1123 — rpfm_server/src/state/tables.rs:1123-1132 | rpfm_server/src/state/tables.rs:1135-1146 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:60 — rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:60-69 | rpfm_lib/src/files/tile_database/render_params/mod.rs:117-126 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) rpfm_lib/src/files/bmd/prop_list/mod.rs:85 — rpfm_lib/src/files/bmd/prop_list/mod.rs:85-94 | rpfm_lib/src/files/tile_database/tile_variation/mod.rs:91-100 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) rpfm_lib/src/files/db/mod.rs:662 — rpfm_lib/src/files/db/mod.rs:662-677 | rpfm_lib/src/files/loc/mod.rs:259-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:662` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:258 — rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:258-273 | rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:299-314 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/esf/esftree/mod.rs:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) rpfm_ui/src/packedfile_views/text/mod.rs:80 — rpfm_ui/src/packedfile_views/text/mod.rs:80-95 | rpfm_ui/src/packedfile_views/text/mod.rs:126-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rpfm_ui/src/tools/mod.rs:841 — rpfm_ui/src/tools/mod.rs:841-857 | rpfm_ui/src/tools/mod.rs:1118-1133 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/mod.rs:841` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×4
  • Duplicated block (12–13 lines × 2) rpfm_lib/src/files/mod.rs:1906 — rpfm_lib/src/files/mod.rs:1906-1918 | rpfm_lib/src/files/pack/mod.rs:493-504 — 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 `rpfm_lib/src/files/mod.rs:1906` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/pack/mod.rs:489` calls `contains`, `Err` and `rpfm_lib/src/files/mod.rs:1905` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) rpfm_lib/src/integrations/assembly_kit/mod.rs:342 — rpfm_lib/src/integrations/assembly_kit/mod.rs:342-354 | rpfm_lib/src/integrations/assembly_kit/mod.rs:357-368 — both copies are in the same file, so extract the 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 `rpfm_lib/src/integrations/assembly_kit/mod.rs:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/integrations/assembly_kit/mod.rs:339` calls `fields_processed` and `rpfm_lib/src/integrations/assembly_kit/mod.rs:354` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) rpfm_ui/src/diagnostics_ui/mod.rs:1527 — rpfm_ui/src/diagnostics_ui/mod.rs:1527-1538 | rpfm_ui/src/diagnostics_ui/mod.rs:1577-1589 — both copies are in the same file, so extract the 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 `rpfm_ui/src/diagnostics_ui/mod.rs:1527` 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–13 lines × 2) rpfm_ui/src/packedfile_views/group_formations/slots.rs:230 — rpfm_ui/src/packedfile_views/group_formations/slots.rs:230-242 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:293-304 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/group_formations/slots.rs:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) rpfm_extensions/src/gltf/mod.rs:271 — rpfm_extensions/src/gltf/mod.rs:271-280 | rpfm_extensions/src/gltf/mod.rs:306-315 | rpfm_extensions/src/gltf/mod.rs:340-349 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/gltf/mod.rs:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) rpfm_ui/src/app_ui/mod.rs:645 — rpfm_ui/src/app_ui/mod.rs:645-654 | rpfm_ui/src/packfile_contents_ui/mod.rs:326-335 | rpfm_ui/src/packfile_contents_ui/mod.rs:359-368 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (10 lines × 3) rpfm_ui/src/app_ui/slots.rs:422 — rpfm_ui/src/app_ui/slots.rs:422-431 | rpfm_ui/src/diagnostics_ui/mod.rs:1235-1244 | rpfm_ui/src/global_search_ui/mod.rs:918-927 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/diagnostics_ui/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) rpfm_ui/src/tools/translator/slots.rs:115 — rpfm_ui/src/tools/translator/slots.rs:115-124 | rpfm_ui/src/tools/translator/slots.rs:136-145 | rpfm_ui/src/tools/translator/slots.rs:155-164 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/translator/slots.rs:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×4
  • Duplicated block (9 lines × 4) rpfm_lib/src/files/bmd/mod.rs:455 — rpfm_lib/src/files/bmd/mod.rs:455-463 | rpfm_lib/src/files/bmd_vegetation/mod.rs:169-177 | rpfm_lib/src/files/hlsl_compiled/mod.rs:141-149 | rpfm_lib/src/files/tile_database/mod.rs:112-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/mod.rs:455` 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 × 4) rpfm_lib/src/games/supported_games.rs:2008 — rpfm_lib/src/games/supported_games.rs:2008-2016 | rpfm_lib/src/games/supported_games.rs:2278-2286 | rpfm_lib/src/games/supported_games.rs:2473-2481 | rpfm_lib/src/games/supported_games.rs:2676-2684 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 4) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:108 — rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:108-116 | rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:135-143 | rpfm_ui/src/packedfile_views/unit_variant/slots.rs:104-112 | rpfm_ui/src/packedfile_views/unit_variant/slots.rs:131-139 — `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs` and `rpfm_ui/src/packedfile_views/unit_variant/slots.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:108` 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 first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&Arc<PortraitSettingsView>` in one and `&Arc<UnitVariantView>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:45 — rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:45-53 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/toggleable_building_slot/building_link/mod.rs:44-52 | rpfm_lib/src/files/tile_database/climate/mod.rs:70-78 | rpfm_lib/src/files/tile_database/tile/mod.rs:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:45` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) rpfm_ui/src/packedfile_views/notes/mod.rs:177 — rpfm_ui/src/packedfile_views/notes/mod.rs:177-181 | rpfm_ui/src/views/table/mod.rs:3542-3546 | rpfm_ui/src/views/table/mod.rs:3728-3732 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) rpfm_extensions/src/dependencies/mod.rs:1068 — rpfm_extensions/src/dependencies/mod.rs:1068-1072 | rpfm_extensions/src/dependencies/mod.rs:1079-1083 | rpfm_extensions/src/dependencies/mod.rs:1090-1094 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:1068` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rpfm_ui/src/dependencies_ui/connections.rs:28 — rpfm_ui/src/dependencies_ui/connections.rs:28-32 | rpfm_ui/src/packedfile_views/esf/connections.rs:28-32 | rpfm_ui/src/packfile_contents_ui/connections.rs:41-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `slots` to `&DependenciesUISlots` in one and `&PackedFileESFViewSlots` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 3) rpfm_ui/src/dependencies_ui/mod.rs:114 — rpfm_ui/src/dependencies_ui/mod.rs:114-118 | rpfm_ui/src/diagnostics_ui/mod.rs:249-253 | rpfm_ui/src/packfile_contents_ui/mod.rs:204-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×3
  • Animation without a prefers-reduced-motion guard website/style.css:168 — `.cta` moves (`transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 80ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/style.css:227 — `.cta-split-toggle svg` moves (`transition: transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/style.css:328 — `.feature` moves (`transition: border-color 160ms ease, transform 160ms ease, background 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D1 · Cyclomatic Complexity · RFile · ×3
  • RFile::decode (cyclomatic 71) rpfm_lib/src/files/mod.rs:2197 — RFile::decode has cyclomatic complexity 71 (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.
  • RFile::encode (cyclomatic 41) rpfm_lib/src/files/mod.rs:2358 — RFile::encode has cyclomatic complexity 41 (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.
  • RFile::guess_file_type (cyclomatic 39) rpfm_lib/src/files/mod.rs:2569 — RFile::guess_file_type has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ToolTranslator · ×3
  • ToolTranslator::new (cyclomatic 40) rpfm_ui/src/tools/translator/mod.rs:294 — ToolTranslator::new has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ToolTranslator::batch_translate_all (cyclomatic 19) rpfm_ui/src/tools/translator/mod.rs:1463 — ToolTranslator::batch_translate_all has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ToolTranslator::change_selected_row (cyclomatic 16) rpfm_ui/src/tools/translator/mod.rs:980 — ToolTranslator::change_selected_row has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchView · ×3
  • SearchView::replace_all (cyclomatic 27) rpfm_ui/src/views/table/search/mod.rs:558 — SearchView::replace_all has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SearchView::update_search_ui (cyclomatic 25) rpfm_ui/src/views/table/search/mod.rs:230 — SearchView::update_search_ui 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.
  • SearchView::replace_current (cyclomatic 18) rpfm_ui/src/views/table/search/mod.rs:486 — SearchView::replace_current has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsUI · ×3
  • SettingsUI::new_with_parent (cyclomatic 23) rpfm_ui/src/settings_ui/mod.rs:222 — SettingsUI::new_with_parent 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.
  • SettingsUI::update_entry_path (cyclomatic 19) rpfm_ui/src/settings_ui/mod.rs:1057 — SettingsUI::update_entry_path has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SettingsUI::load (cyclomatic 17) rpfm_ui/src/settings_ui/mod.rs:838 — SettingsUI::load has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · DB · ×3
  • DB::cascade_edition (cognitive 126) rpfm_lib/src/files/db/mod.rs:485 — DB::cascade_edition has cognitive complexity 126 (threshold 15). Drivers by points: if/else 18 (84 pts), loops 9 (36 pts), match/switch 1 (6 pts) (nesting depth added 98). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DB::generate_twad_key_deletes_keys (cognitive 26) rpfm_lib/src/files/db/mod.rs:720 — DB::generate_twad_key_deletes_keys has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • DB::optimize (cognitive 22) rpfm_extensions/src/optimizer/mod.rs:545 — DB::optimize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, match/switch 2 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SearchView · ×3
  • SearchView::update_search_ui (cognitive 64) rpfm_ui/src/views/table/search/mod.rs:230 — SearchView::update_search_ui has cognitive complexity 64 (threshold 15). Drivers by points: if/else 30 (59 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SearchView::replace_all (cognitive 45) rpfm_ui/src/views/table/search/mod.rs:558 — SearchView::replace_all has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 3 (11 pts), loops 3 (7 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SearchView::replace_current (cognitive 27) rpfm_ui/src/views/table/search/mod.rs:486 — SearchView::replace_current has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsUI · ×3
  • SettingsUI::new_with_parent (cognitive 54) rpfm_ui/src/settings_ui/mod.rs:222 — SettingsUI::new_with_parent has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 8 (15 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SettingsUI::update_entry_path (cognitive 27) rpfm_ui/src/settings_ui/mod.rs:1057 — SettingsUI::update_entry_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 4 (10 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SettingsUI::load (cognitive 22) rpfm_ui/src/settings_ui/mod.rs:838 — SettingsUI::load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 7, boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Checker · ×3
  • Checker::follow_chain (cognitive 53) rpfm_extensions/src/lua/check.rs:306 — Checker::follow_chain has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (35 pts), match/switch 6 (13 pts), boolean chains 4, loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Checker::check_call (cognitive 19) rpfm_extensions/src/lua/check.rs:413 — Checker::check_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Checker::check_listener (cognitive 19) rpfm_extensions/src/lua/check.rs:454 — Checker::check_listener has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RFile · ×3
  • RFile::guess_file_type (cognitive 39) rpfm_lib/src/files/mod.rs:2569 — RFile::guess_file_type has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29, boolean chains 10. 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.
  • RFile::decode (cognitive 28) rpfm_lib/src/files/mod.rs:2197 — RFile::decode has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 5 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RFile::encode (cognitive 24) rpfm_lib/src/files/mod.rs:2358 — RFile::encode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchedCombat · ×3
  • MatchedCombat::write_v1_3k (cognitive 20) rpfm_lib/src/files/matched_combat/versions/v1_3k.rs:80 — MatchedCombat::write_v1_3k has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (20 pts) (nesting depth added 14). 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.
  • MatchedCombat::read_v3 (cognitive 20) rpfm_lib/src/files/matched_combat/versions/v3.rs:27 — MatchedCombat::read_v3 has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (20 pts) (nesting depth added 14). 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. This shape REPEATS in the file: one other method here (MatchedCombat::write_v3) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • MatchedCombat::write_v3 (cognitive 20) rpfm_lib/src/files/matched_combat/versions/v3.rs:94 — MatchedCombat::write_v3 has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (20 pts) (nesting depth added 14). 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. This shape REPEATS in the file: one other method here (MatchedCombat::read_v3) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SoundEvents · ×3
  • SoundEvents::write_emp (cognitive 17) rpfm_lib/src/files/sound_events/games/emp.rs:136 — SoundEvents::write_emp has cognitive complexity 17 (threshold 15). Drivers by points: loops 9 (11 pts), if/else 2 (5 pts), boolean chains 1 (nesting depth added 5). 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.
  • SoundEvents::read_sho2 (cognitive 17) rpfm_lib/src/files/sound_events/games/sho2.rs:15 — SoundEvents::read_sho2 has cognitive complexity 17 (threshold 15). Drivers by points: loops 13 (15 pts), if/else 1 (2 pts) (nesting depth added 3). 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. This shape REPEATS in the file: one other method here (SoundEvents::write_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • SoundEvents::write_sho2 (cognitive 17) rpfm_lib/src/files/sound_events/games/sho2.rs:200 — SoundEvents::write_sho2 has cognitive complexity 17 (threshold 15). Drivers by points: loops 13 (15 pts), if/else 1 (2 pts) (nesting depth added 3). 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. This shape REPEATS in the file: one other method here (SoundEvents::read_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) rpfm_ui/src/tools/unit_editor/mod.rs:754 — rpfm_ui/src/tools/unit_editor/mod.rs:754-772 | rpfm_ui/src/tools/unit_editor/mod.rs:775-793 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) rpfm_ui/src/tools/translator/mod.rs:1123 — rpfm_ui/src/tools/translator/mod.rs:1123-1141 | rpfm_ui/src/tools/translator/mod.rs:1143-1161 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) rpfm_lib/src/files/sound_bank_database/mod.rs:496 — rpfm_lib/src/files/sound_bank_database/mod.rs:496-514 | rpfm_lib/src/files/sound_events/mod.rs:337-355 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) rpfm_lib/src/binary/writer.rs:461 — rpfm_lib/src/binary/writer.rs:461-477 | rpfm_lib/src/binary/writer.rs:588-604 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) rpfm_lib/src/files/bmd/civilian_deployment_list/mod.rs:54 — rpfm_lib/src/files/bmd/civilian_deployment_list/mod.rs:54-71 | rpfm_lib/src/files/bmd/civilian_shelter_list/mod.rs:51-67 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) rpfm_lib/src/schema/mod.rs:2427 — rpfm_lib/src/schema/mod.rs:2427-2444 | rpfm_lib/src/schema/v4.rs:334-350 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) rpfm_lib/src/files/pack/mod.rs:1487 — rpfm_lib/src/files/pack/mod.rs:1487-1506 | rpfm_lib/src/files/pack/mod.rs:1526-1545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/pack/mod.rs:1487` 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 (20 lines × 2) rpfm_ui/src/packedfile_views/bmd/slots.rs:43 — rpfm_ui/src/packedfile_views/bmd/slots.rs:43-62 | rpfm_ui/src/packedfile_views/text/slots.rs:48-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&Arc<FileBMDView>` in one and `&Arc<PackedFileTextView>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/connections.rs:26 — rpfm_ui/src/packedfile_views/portrait_settings/connections.rs:26-45 | rpfm_ui/src/packedfile_views/unit_variant/connections.rs:26-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `slots` to `&PortraitSettingsSlots` in one and `&UnitVariantSlots` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packedfile_views/portrait_settings/connections.rs:46` calls `main_list_delete_filtered`, `triggered`, `connect` and `rpfm_ui/src/packedfile_views/unit_variant/connections.rs:47` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×3
  • Duplicated block (17 lines × 2) rpfm_extensions/src/optimizer/mod.rs:605 — rpfm_extensions/src/optimizer/mod.rs:605-621 | rpfm_extensions/src/optimizer/mod.rs:669-685 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/optimizer/mod.rs:605` 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) rpfm_ui/src/packedfile_views/dependencies_manager/mod.rs:67 — rpfm_ui/src/packedfile_views/dependencies_manager/mod.rs:67-83 | rpfm_ui/src/packedfile_views/table/mod.rs:74-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:827 — rpfm_ui/src/tools/faction_painter/mod.rs:827-843 | rpfm_ui/src/tools/faction_painter/mod.rs:911-927 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:827` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) rpfm_lib/src/files/esf/utils.rs:540 — rpfm_lib/src/files/esf/utils.rs:540-551 | rpfm_lib/src/files/esf/utils.rs:555-566 | rpfm_lib/src/files/esf/utils.rs:570-581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/esf/utils.rs:540` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) rpfm_ui/src/global_search_ui/mod.rs:1510 — rpfm_ui/src/global_search_ui/mod.rs:1510-1521 | rpfm_ui/src/global_search_ui/mod.rs:1649-1660 | rpfm_ui/src/global_search_ui/mod.rs:1938-1949 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/global_search_ui/mod.rs:1510` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) rpfm_ui/src/tools/faction_painter/mod.rs:984 — rpfm_ui/src/tools/faction_painter/mod.rs:984-995 | rpfm_ui/src/tools/faction_painter/mod.rs:1049-1060 | rpfm_ui/src/tools/faction_painter/mod.rs:1115-1126 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:984` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) rpfm_ui/src/packedfile_views/mod.rs:520 — rpfm_ui/src/packedfile_views/mod.rs:520-529 | rpfm_ui/src/packedfile_views/mod.rs:544-552 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/mod.rs:520` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) rpfm_ui/src/views/table/mod.rs:2645 — rpfm_ui/src/views/table/mod.rs:2645-2653 | rpfm_ui/src/views/table/mod.rs:2726-2735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/views/table/mod.rs:2655` calls `push` and `rpfm_ui/src/views/table/mod.rs:2735` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 2) rpfm_extensions/src/translator/mod.rs:394 — rpfm_extensions/src/translator/mod.rs:394-403 | rpfm_extensions/src/translator/mod.rs:411-419 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/translator/mod.rs:394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:950 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:950-959 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:973-982 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:441-450 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:467-476 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:950` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1019 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1019-1028 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1042-1051 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:496-505 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:520-529 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1019` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) rpfm_ui/src/packedfile_views/decoder/slots.rs:267 — rpfm_ui/src/packedfile_views/decoder/slots.rs:267-276 | rpfm_ui/src/packedfile_views/decoder/slots.rs:308-317 | rpfm_ui/src/packedfile_views/decoder/slots.rs:342-351 | rpfm_ui/src/packedfile_views/decoder/slots.rs:383-392 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/decoder/slots.rs:267` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×3
  • Duplicated block (5 lines × 6) rpfm_extensions/src/dependencies/mod.rs:527 — rpfm_extensions/src/dependencies/mod.rs:527-531 | rpfm_extensions/src/dependencies/mod.rs:538-542 | rpfm_extensions/src/dependencies/mod.rs:738-742 | rpfm_extensions/src/dependencies/mod.rs:887-891 | rpfm_extensions/src/dependencies/mod.rs:968-972 | rpfm_extensions/src/dependencies/mod.rs:980-984 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_extensions/src/dependencies/mod.rs:546` calls `bruteforce_loc_key_order`, `default`, `Some` and `rpfm_extensions/src/dependencies/mod.rs:988` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 6) rpfm_ui/src/app_ui/slots.rs:439 — rpfm_ui/src/app_ui/slots.rs:439-443 | rpfm_ui/src/app_ui/slots.rs:449-453 | rpfm_ui/src/app_ui/slots.rs:459-463 | rpfm_ui/src/references_ui/mod.rs:252-256 | rpfm_ui/src/views/table/mod.rs:3843-3847 | rpfm_ui/src/views/table/mod.rs:4087-4091 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 6) rpfm_ui/src/global_search_ui/mod.rs:1233 — rpfm_ui/src/global_search_ui/mod.rs:1233-1237 | rpfm_ui/src/global_search_ui/mod.rs:1378-1382 | rpfm_ui/src/global_search_ui/mod.rs:1461-1465 | rpfm_ui/src/global_search_ui/mod.rs:1595-1599 | rpfm_ui/src/global_search_ui/mod.rs:1738-1742 | rpfm_ui/src/global_search_ui/mod.rs:1904-1908 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/global_search_ui/mod.rs:1375` calls `new_item` and `rpfm_ui/src/global_search_ui/mod.rs:1229` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) rpfm_lib/src/files/bmd/ef_line_list/mod.rs:35 — rpfm_lib/src/files/bmd/ef_line_list/mod.rs:35-52 | rpfm_lib/src/files/bmd/lite_building_outlines/mod.rs:36-53 — 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 `rpfm_lib/src/files/bmd/ef_line_list/mod.rs:35` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) rpfm_lib/src/files/bmd/mod.rs:636 — rpfm_lib/src/files/bmd/mod.rs:636-653 | rpfm_lib/src/files/bmd/mod.rs:662-680 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/bmd/mod.rs:636` 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) rpfm_ui/src/app_ui/mod.rs:3810 — rpfm_ui/src/app_ui/mod.rs:3810-3827 | rpfm_ui/src/app_ui/mod.rs:3842-3859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: rpfm_telemetry — rpfm_telemetry: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: rpfm_lib — rpfm_lib: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: rpfm_extensions — rpfm_extensions: abstractness 0.02, instability 0.25, distance 0.73 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience rpfm_ui/src/session_ui/mod.rs:191 — `reqwest::blocking::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience rpfm_ui/src/tools/translator/mod.rs:1209 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience rpfm_ui/src/tools/translator/mod.rs:1287 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D1 · Cyclomatic Complexity · DecodedData · ×2
  • DecodedData::convert_between_types (cyclomatic 121) rpfm_lib/src/files/table/mod.rs:846 — DecodedData::convert_between_types has cyclomatic complexity 121 (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.
  • DecodedData::new_from_type_and_value (cyclomatic 42) rpfm_lib/src/files/table/mod.rs:648 — DecodedData::new_from_type_and_value has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SoundBankDatabase · ×2
  • SoundBankDatabase::read_sho2 (cyclomatic 112) rpfm_lib/src/files/sound_bank_database/games/sho2.rs:15 — SoundBankDatabase::read_sho2 has cyclomatic complexity 112 (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. This shape REPEATS in the file: one other method here (SoundBankDatabase::write_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • SoundBankDatabase::write_sho2 (cyclomatic 112) rpfm_lib/src/files/sound_bank_database/games/sho2.rs:567 — SoundBankDatabase::write_sho2 has cyclomatic complexity 112 (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. This shape REPEATS in the file: one other method here (SoundBankDatabase::read_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · TableDiagnostic · ×2
  • TableDiagnostic::check_db (cyclomatic 92) rpfm_extensions/src/diagnostics/table.rs:239 — TableDiagnostic::check_db has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TableDiagnostic::check_loc (cyclomatic 32) rpfm_extensions/src/diagnostics/table.rs:636 — TableDiagnostic::check_loc has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GlobalSearch · ×2
  • GlobalSearch::replace (cyclomatic 66) rpfm_extensions/src/search/mod.rs:578 — GlobalSearch::replace has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalSearch::search (cyclomatic 18) rpfm_extensions/src/search/mod.rs:416 — GlobalSearch::search has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: GlobalSearch::replace_possible (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Icons · ×2
  • Icons::icon (cyclomatic 58) rpfm_ui_common/src/icons/mod.rs:186 — Icons::icon has cyclomatic complexity 58 (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.
  • Icons::set_standard_item_icon (cyclomatic 52) rpfm_ui_common/src/icons/mod.rs:352 — Icons::set_standard_item_icon has cyclomatic complexity 52 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DB · ×2
  • DB::generate_twad_key_deletes_keys (cyclomatic 56) rpfm_lib/src/files/db/mod.rs:720 — DB::generate_twad_key_deletes_keys has cyclomatic complexity 56 (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.
  • DB::cascade_edition (cyclomatic 28) rpfm_lib/src/files/db/mod.rs:485 — DB::cascade_edition has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileView · ×2
  • FileView::reload (cyclomatic 47) rpfm_ui/src/packedfile_views/mod.rs:502 — FileView::reload has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • FileView::save (cyclomatic 35) rpfm_ui/src/packedfile_views/mod.rs:337 — FileView::save has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AnimFragmentBattle · ×2
  • AnimFragmentBattle::search (cyclomatic 34) rpfm_extensions/src/search/anim_fragment_battle.rs:93 — AnimFragmentBattle::search has cyclomatic complexity 34 (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.
  • AnimFragmentBattle::from_table (cyclomatic 31) rpfm_lib/src/files/anim_fragment_battle/mod.rs:362 — AnimFragmentBattle::from_table has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tool · ×2
  • Tool::load_definition_to_detailed_view_editor (cyclomatic 30) rpfm_ui/src/tools/mod.rs:676 — Tool::load_definition_to_detailed_view_editor has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Tool::get_table_data (cyclomatic 26) rpfm_ui/src/tools/mod.rs:328 — Tool::get_table_data has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Definition · ×2
  • Definition::update_from_raw_definition (cyclomatic 29) rpfm_lib/src/schema/mod.rs:1843 — Definition::update_from_raw_definition has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Definition::update_fields_processed (cyclomatic 23) rpfm_lib/src/schema/mod.rs:1481 — Definition::update_fields_processed has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RawDefinition · ×2
  • RawDefinition::read_all (cyclomatic 27) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:487 — RawDefinition::read_all has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RawDefinition::from (cyclomatic 20) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:840 — RawDefinition::from has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolFactionPainter · ×2
  • ToolFactionPainter::get_faction_data (cyclomatic 25) rpfm_ui/src/tools/faction_painter/mod.rs:590 — ToolFactionPainter::get_faction_data 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.
  • ToolFactionPainter::load_data (cyclomatic 19) rpfm_ui/src/tools/faction_painter/mod.rs:259 — ToolFactionPainter::load_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · FixmeComment · ×2
  • FixmeComment rpfm_lib/src/files/dat/mod.rs:146 — /// FIXME: Possible wrong implementation. — 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 rpfm_lib/src/files/anims_table/mod.rs:190 — /// FIXME: This is possibly not table_name, but skeleton_type, and skeleton_type is possibly skeleton_type_cinematic. — 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.
D2 · Cognitive Complexity · TableDiagnostic · ×2
  • TableDiagnostic::check_db (cognitive 308) rpfm_extensions/src/diagnostics/table.rs:239 — TableDiagnostic::check_db has cognitive complexity 308 (threshold 15). Drivers by points: if/else 51 (225 pts), loops 9 (33 pts), boolean chains 29, match/switch 5 (21 pts) (nesting depth added 214). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • TableDiagnostic::check_loc (cognitive 78) rpfm_extensions/src/diagnostics/table.rs:636 — TableDiagnostic::check_loc has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (50 pts), match/switch 4 (14 pts), loops 6 (8 pts), boolean chains 6 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SoundBankDatabase · ×2
  • SoundBankDatabase::read_sho2 (cognitive 195) rpfm_lib/src/files/sound_bank_database/games/sho2.rs:15 — SoundBankDatabase::read_sho2 has cognitive complexity 195 (threshold 15). Drivers by points: loops 111 (195 pts) (nesting depth added 84). 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. This shape REPEATS in the file: one other method here (SoundBankDatabase::write_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • SoundBankDatabase::write_sho2 (cognitive 195) rpfm_lib/src/files/sound_bank_database/games/sho2.rs:567 — SoundBankDatabase::write_sho2 has cognitive complexity 195 (threshold 15). Drivers by points: loops 111 (195 pts) (nesting depth added 84). 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. This shape REPEATS in the file: one other method here (SoundBankDatabase::read_sho2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · RawDefinition · ×2
  • RawDefinition::read_all (cognitive 185) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:487 — RawDefinition::read_all has cognitive complexity 185 (threshold 15). Drivers by points: if/else 25 (153 pts), loops 3 (27 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 153). 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.
  • RawDefinition::from (cognitive 61) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:840 — RawDefinition::from has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (50 pts), match/switch 1 (7 pts), loops 1 (4 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GlobalSearch · ×2
  • GlobalSearch::replace (cognitive 170) rpfm_extensions/src/search/mod.rs:578 — GlobalSearch::replace has cognitive complexity 170 (threshold 15). Drivers by points: if/else 33 (118 pts), match/switch 12 (51 pts), loops 1 (nesting depth added 124). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalSearch::search (cognitive 32) rpfm_extensions/src/search/mod.rs:416 — GlobalSearch::search has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileView · ×2
  • FileView::reload (cognitive 119) rpfm_ui/src/packedfile_views/mod.rs:502 — FileView::reload has cognitive complexity 119 (threshold 15). Drivers by points: if/else 46 (114 pts), match/switch 2 (5 pts) (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FileView::save (cognitive 37) rpfm_ui/src/packedfile_views/mod.rs:337 — FileView::save has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (12 pts), loops 1 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Diagnostics · ×2
  • Diagnostics::check (cognitive 96) rpfm_extensions/src/diagnostics/mod.rs:314 — Diagnostics::check has cognitive complexity 96 (threshold 15). Drivers by points: if/else 43 (71 pts), match/switch 5 (13 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Diagnostics::ignore_data_for_file (cognitive 30) rpfm_extensions/src/diagnostics/mod.rs:638 — Diagnostics::ignore_data_for_file has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (7 pts), match/switch 1 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnimFragmentBattle · ×2
  • AnimFragmentBattle::search (cognitive 89) rpfm_extensions/src/search/anim_fragment_battle.rs:93 — AnimFragmentBattle::search has cognitive complexity 89 (threshold 15). Drivers by points: loops 30 (84 pts), if/else 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 55). 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.
  • AnimFragmentBattle::from_table (cognitive 70) rpfm_lib/src/files/anim_fragment_battle/mod.rs:362 — AnimFragmentBattle::from_table has cognitive complexity 70 (threshold 15). Drivers by points: if/else 28 (65 pts), loops 2 (5 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Definition · ×2
  • Definition::update_from_raw_definition (cognitive 89) rpfm_lib/src/schema/mod.rs:1843 — Definition::update_from_raw_definition has cognitive complexity 89 (threshold 15). Drivers by points: if/else 17 (66 pts), match/switch 2 (9 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Definition::update_fields_processed (cognitive 41) rpfm_lib/src/schema/mod.rs:1481 — Definition::update_fields_processed has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 3 (8 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Schema · ×2
  • Schema::tables_and_columns_referencing_our_own (cognitive 54) rpfm_lib/src/schema/mod.rs:1229 — Schema::tables_and_columns_referencing_our_own has cognitive complexity 54 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 5 (20 pts), match/switch 1 (7 pts), boolean chains 3 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Schema::search (cognitive 52) rpfm_extensions/src/search/schema.rs:63 — Schema::search has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (34 pts), loops 5 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Icons · ×2
  • Icons::icon (cognitive 54) rpfm_ui_common/src/icons/mod.rs:186 — Icons::icon has cognitive complexity 54 (threshold 15). Drivers by points: if/else 37 (41 pts), boolean chains 9, match/switch 2 (4 pts) (nesting depth added 6). 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.
  • Icons::set_standard_item_icon (cognitive 24) rpfm_ui_common/src/icons/mod.rs:352 — Icons::set_standard_item_icon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 4 (10 pts), boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DecodedData · ×2
  • DecodedData::new_from_type_and_value (cognitive 45) rpfm_lib/src/files/table/mod.rs:648 — DecodedData::new_from_type_and_value has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (40 pts), match/switch 3 (5 pts) (nesting depth added 22). 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.
  • DecodedData::convert_between_types (cognitive 25) rpfm_lib/src/files/table/mod.rs:846 — DecodedData::convert_between_types has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 10 (13 pts), if/else 6 (12 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TableInMemory · ×2
  • TableInMemory::tsv_import (cognitive 29) rpfm_lib/src/files/table/local.rs:358 — TableInMemory::tsv_import has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (17 pts), match/switch 2 (8 pts), loops 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TableInMemory::set_definition (cognitive 20) rpfm_lib/src/files/table/local.rs:761 — TableInMemory::set_definition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MyModUI · ×2
  • MyModUI::new (cognitive 25) rpfm_ui/src/mymod_ui/mod.rs:85 — MyModUI::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MyModUI::update_dialog (cognitive 17) rpfm_ui/src/mymod_ui/mod.rs:217 — MyModUI::update_dialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolUnitEditor · ×2
  • ToolUnitEditor::new (cognitive 25) rpfm_ui/src/tools/unit_editor/mod.rs:204 — ToolUnitEditor::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolUnitEditor::load_unit_icons (cognitive 20) rpfm_ui/src/tools/unit_editor/mod.rs:601 — ToolUnitEditor::load_unit_icons has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CampaignRows · ×2
  • CampaignRows::new (cognitive 24) rpfm_extensions/src/startpos/split.rs:79 — CampaignRows::new has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (10 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CampaignRows::add_referenced_rows (cognitive 17) rpfm_extensions/src/startpos/split.rs:173 — CampaignRows::add_referenced_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackFileContentsUI · ×2
  • PackFileContentsUI::create_rename_dialog (cognitive 24) rpfm_ui/src/packfile_contents_ui/mod.rs:627 — PackFileContentsUI::create_rename_dialog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PackFileContentsUI::add_files (cognitive 17) rpfm_ui/src/packfile_contents_ui/mod.rs:544 — PackFileContentsUI::add_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (3 pts), boolean chains 2, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LuaApi · ×2
  • LuaApi::add_scripting_doc (cognitive 23) rpfm_extensions/src/lua/mod.rs:505 — LuaApi::add_scripting_doc has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LuaApi::hover_html (cognitive 20) rpfm_extensions/src/lua/mod.rs:390 — LuaApi::hover_html has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AssetVariationDb · ×2
  • AssetVariationDb::validate (cognitive 23) rpfm_lib/src/files/asset_variation_db/mod.rs:271 — AssetVariationDb::validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AssetVariationDb::from_xml (cognitive 16) rpfm_lib/src/files/asset_variation_db/xml.rs:61 — AssetVariationDb::from_xml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GroupFormation · ×2
  • GroupFormation::validate (cognitive 23) rpfm_lib/src/files/group_formations/validation.rs:122 — GroupFormation::validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (7 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GroupFormation::delete_blocks (cognitive 16) rpfm_lib/src/files/group_formations/edit.rs:250 — GroupFormation::delete_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 4 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Atlas · ×2
  • Atlas::search (cognitive 21) rpfm_extensions/src/search/atlas.rs:73 — Atlas::search has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Atlas::from (cognitive 16) rpfm_lib/src/files/atlas/mod.rs:139 — Atlas::from has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) rpfm_extensions/src/search/mod.rs:416 — rpfm_extensions/src/search/mod.rs:416-532 | rpfm_extensions/src/search/mod.rs:578-828 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) rpfm_extensions/src/merge/mod.rs:181 — rpfm_extensions/src/merge/mod.rs:181-195 | rpfm_extensions/src/merge/mod.rs:199-213 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rpfm_ui/src/app_ui/slots.rs:400 — rpfm_ui/src/app_ui/slots.rs:400-469 | rpfm_ui/src/global_search_ui/mod.rs:879-1189 | rpfm_ui/src/references_ui/mod.rs:221-288 | rpfm_ui/src/views/table/mod.rs:3774-3887 | rpfm_ui/src/views/table/mod.rs:3900-4014 | rpfm_ui/src/views/table/mod.rs:4029-4129 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rpfm_ui/src/packedfile_views/anim_fragment_battle/mod.rs:95 — rpfm_ui/src/packedfile_views/anim_fragment_battle/mod.rs:95-203 | rpfm_ui/src/packedfile_views/audio/mod.rs:63-98 | rpfm_ui/src/packedfile_views/group_formations/mod.rs:257-536 | rpfm_ui/src/packedfile_views/packfile/mod.rs:100-159 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:196-496 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:140-259 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) rpfm_lib/src/files/bmd/common/mod.rs:760 — rpfm_lib/src/files/bmd/common/mod.rs:760-775 | rpfm_lib/src/files/bmd/common/mod.rs:804-823 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) rpfm_lib/src/files/bmd/common/mod.rs:740 — rpfm_lib/src/files/bmd/common/mod.rs:740-755 | rpfm_lib/src/files/bmd/common/mod.rs:780-799 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×2
  • Edited copy of a member (7 corresponding lines) rpfm_ui/src/packedfile_views/group_formations/mod.rs:750 — rpfm_ui/src/packedfile_views/group_formations/mod.rs:750-756 | rpfm_ui/src/packedfile_views/group_formations/mod.rs:759-765 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) rpfm_lib/src/integrations/github/mod.rs:265 — rpfm_lib/src/integrations/github/mod.rs:265-271 | rpfm_lib/src/integrations/github/mod.rs:328-334 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) rpfm_ui/src/ffi/mod.rs:601 — rpfm_ui/src/ffi/mod.rs:601-605 | rpfm_ui/src/ffi/mod.rs:615-619 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1106 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:1106-1110 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:596-600 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×2
  • Edited copy of a member (9 corresponding lines) rpfm_ui/src/packedfile_views/bmd/mod.rs:93 — rpfm_ui/src/packedfile_views/bmd/mod.rs:93-101 | rpfm_ui/src/packedfile_views/vmd/mod.rs:170-179 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) rpfm_lib/src/files/mod.rs:2523 — rpfm_lib/src/files/mod.rs:2523-2531 | rpfm_lib/src/files/mod.rs:3012-3020 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) rpfm_extensions/src/startpos/extract/characters.rs:460 — rpfm_extensions/src/startpos/extract/characters.rs:460-463 | rpfm_extensions/src/startpos/extract/missions.rs:177-181 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:985 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:985-988 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:479-482 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1389 — rpfm_extensions/src/dependencies/mod.rs:1389-1426 | rpfm_extensions/src/dependencies/mod.rs:1438-1475 — both copies are in the same file, so extract the 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 (38 lines × 2) rpfm_ui/src/tools/unit_editor/mod.rs:386 — rpfm_ui/src/tools/unit_editor/mod.rs:386-431 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:250-287 — before extracting anything, compare `rpfm_ui/src/tools/unit_editor/mod.rs` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 261 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/unit_editor/mod.rs:386` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/tools/unit_editor/mod.rs:434` calls `setup_widgets_relations` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:290` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) rpfm_lib/src/files/pack/mod.rs:861 — rpfm_lib/src/files/pack/mod.rs:861-879 | rpfm_lib/src/files/pack/mod.rs:925-943 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/pack/mod.rs:861` 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 (19 lines × 2) rpfm_ui/src/views/table/search/mod.rs:409 — rpfm_ui/src/views/table/search/mod.rs:409-427 | rpfm_ui/src/views/table/search/mod.rs:452-470 — both copies are in the same file, so extract the 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 `rpfm_ui/src/views/table/search/mod.rs:409` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2794 — rpfm_extensions/src/dependencies/mod.rs:2794-2806 | rpfm_extensions/src/dependencies/mod.rs:2869-2882 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2794` 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 (13–14 lines × 2) rpfm_ui/src/packfile_contents_ui/mod.rs:325 — rpfm_ui/src/packfile_contents_ui/mod.rs:325-338 | rpfm_ui/src/packfile_contents_ui/mod.rs:358-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×2
  • Duplicated block (12 lines × 5) rpfm_server/src/ceo_builder.rs:411 — rpfm_server/src/ceo_builder.rs:411-422 | rpfm_server/src/ceo_builder.rs:500-511 | rpfm_server/src/ceo_builder.rs:583-594 | rpfm_server/src/ceo_builder.rs:676-687 | rpfm_server/src/ceo_builder.rs:759-770 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/ceo_builder.rs:411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 5) rpfm_ui/src/ffi/mod.rs:828 — rpfm_ui/src/ffi/mod.rs:828-839 | rpfm_ui/src/tools/translator/mod.rs:479-490 | rpfm_ui/src/tools/translator/mod.rs:509-520 | rpfm_ui/src/tools/translator/mod.rs:1895-1906 | rpfm_ui/src/views/table/utils.rs:1397-1408 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) rpfm_lib/src/files/mod.rs:2217 — rpfm_lib/src/files/mod.rs:2217-2227 | rpfm_lib/src/files/mod.rs:2279-2290 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/mod.rs:2217` 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–12 lines × 2) rpfm_lib/src/games/supported_games.rs:398 — rpfm_lib/src/games/supported_games.rs:398-408 | rpfm_lib/src/games/supported_games.rs:595-606 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/supported_games.rs:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) rpfm_lib/src/files/esf/utils.rs:541 — rpfm_lib/src/files/esf/utils.rs:541-551 | rpfm_lib/src/files/esf/utils.rs:556-566 | rpfm_lib/src/files/esf/utils.rs:571-581 | rpfm_lib/src/files/esf/utils.rs:586-596 | rpfm_lib/src/files/esf/utils.rs:601-611 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/esf/utils.rs:541` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 5) rpfm_extensions/src/search/anim_fragment_battle.rs:538 — rpfm_extensions/src/search/anim_fragment_battle.rs:538-548 | rpfm_extensions/src/search/atlas.rs:150-160 | rpfm_extensions/src/search/portrait_settings.rs:354-364 | rpfm_extensions/src/search/rigid_model.rs:380-390 | rpfm_extensions/src/search/unit_variant.rs:174-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `search_matches` to `&AnimFragmentBattleMatches` in one and `&AtlasMatches` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:133 — rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:133-143 | rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:153-163 | rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:171-181 | rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:189-199 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/diagnostics/anim_fragment_battle.rs: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 (11 lines × 4) rpfm_lib/src/games/supported_games.rs:560 — rpfm_lib/src/games/supported_games.rs:560-570 | rpfm_lib/src/games/supported_games.rs:757-767 | rpfm_lib/src/games/supported_games.rs:1173-1183 | rpfm_lib/src/games/supported_games.rs:1992-2002 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) rpfm_ui/src/app_ui/mod.rs:3161 — rpfm_ui/src/app_ui/mod.rs:3161-3171 | rpfm_ui/src/app_ui/mod.rs:3317-3327 | rpfm_ui/src/app_ui/mod.rs:3353-3363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/app_ui/mod.rs:3315` calls `from_q_string`, `qtr` and `rpfm_ui/src/app_ui/mod.rs:3351` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) rpfm_ui/src/packfile_contents_ui/slots.rs:1278 — rpfm_ui/src/packfile_contents_ui/slots.rs:1278-1290 | rpfm_ui/src/packfile_contents_ui/slots.rs:1432-1443 | rpfm_ui/src/packfile_contents_ui/slots.rs:1514-1524 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packfile_contents_ui/slots.rs:1278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) rpfm_lib/src/games/supported_games.rs:2460 — rpfm_lib/src/games/supported_games.rs:2460-2467 | rpfm_lib/src/games/supported_games.rs:2663-2670 | rpfm_lib/src/games/supported_games.rs:2856-2863 | rpfm_lib/src/games/supported_games.rs:3030-3037 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:2460` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:94 — rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:94-101 | rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:109-116 | rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:125-132 | rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:140-147 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:92` calls `set_word_wrap` and `rpfm_ui/src/packedfile_views/packfile_settings/mod.rs:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) rpfm_ui/src/packedfile_views/decoder/mod.rs:1122 — rpfm_ui/src/packedfile_views/decoder/mod.rs:1122-1129 | rpfm_ui/src/packedfile_views/decoder/mod.rs:1213-1219 — both copies are in the same file, so extract the 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 `rpfm_ui/src/packedfile_views/decoder/mod.rs:1122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) rpfm_ui/src/app_ui/mod.rs:2965 — rpfm_ui/src/app_ui/mod.rs:2965-2971 | rpfm_ui/src/app_ui/mod.rs:3067-3074 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:2965` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) rpfm_server/src/updater.rs:246 — rpfm_server/src/updater.rs:246-252 | rpfm_server/src/updater.rs:253-259 | rpfm_server/src/updater.rs:265-271 | rpfm_server/src/updater.rs:276-282 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/updater.rs:246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_server/src/updater.rs:259` calls `Ok` and `rpfm_server/src/updater.rs:252` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:70 — rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:70-76 | rpfm_lib/src/files/bmd/common/flags/mod.rs:154-160 | rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:73-79 | rpfm_lib/src/files/bmd/tree_list_reference_list/mod.rs:62-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/bmd/ai_hints/polylines/hint_polyline/mod.rs:68` calls `write_v1` and `rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:71` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×2
  • Duplicated block (6 lines × 9) rpfm_lib/src/files/db/mod.rs:729 — rpfm_lib/src/files/db/mod.rs:729-734 | rpfm_lib/src/files/db/mod.rs:874-879 | rpfm_lib/src/files/db/mod.rs:903-908 | rpfm_lib/src/files/db/mod.rs:957-962 | rpfm_lib/src/files/db/mod.rs:1022-1027 | rpfm_lib/src/files/db/mod.rs:1062-1067 | rpfm_lib/src/files/db/mod.rs:1139-1144 | rpfm_lib/src/files/db/mod.rs:1205-1210 | rpfm_lib/src/files/db/mod.rs:1287-1292 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:729` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/db/mod.rs:871` calls `column_position_by_name`, `unwrap_or_default` and `rpfm_lib/src/files/db/mod.rs:954` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 9) rpfm_lib/src/files/db/mod.rs:741 — rpfm_lib/src/files/db/mod.rs:741-746 | rpfm_lib/src/files/db/mod.rs:801-806 | rpfm_lib/src/files/db/mod.rs:813-818 | rpfm_lib/src/files/db/mod.rs:838-843 | rpfm_lib/src/files/db/mod.rs:862-867 | rpfm_lib/src/files/db/mod.rs:915-920 | rpfm_lib/src/files/db/mod.rs:927-932 | rpfm_lib/src/files/db/mod.rs:984-989 | rpfm_lib/src/files/db/mod.rs:1193-1198 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:741` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×2
  • Duplicated block (5 lines × 7) rpfm_lib/src/games/supported_games.rs:379 — rpfm_lib/src/games/supported_games.rs:379-383 | rpfm_lib/src/games/supported_games.rs:576-580 | rpfm_lib/src/games/supported_games.rs:773-777 | rpfm_lib/src/games/supported_games.rs:992-996 | rpfm_lib/src/games/supported_games.rs:1189-1193 | rpfm_lib/src/games/supported_games.rs:1473-1477 | rpfm_lib/src/games/supported_games.rs:3837-3841 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:379` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 7) rpfm_ui/src/settings_ui/mod.rs:383 — rpfm_ui/src/settings_ui/mod.rs:383-387 | rpfm_ui/src/settings_ui/mod.rs:435-439 | rpfm_ui/src/settings_ui/mod.rs:472-476 | rpfm_ui/src/settings_ui/mod.rs:501-505 | rpfm_ui/src/settings_ui/mod.rs:517-521 | rpfm_ui/src/settings_ui/mod.rs:533-537 | rpfm_ui/src/settings_ui/mod.rs:559-563 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) rpfm_lib/src/files/db/mod.rs:1001 — rpfm_lib/src/files/db/mod.rs:1001-1006 | rpfm_lib/src/files/db/mod.rs:1130-1135 | rpfm_lib/src/files/db/mod.rs:1154-1159 | rpfm_lib/src/files/db/mod.rs:1168-1173 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:1001` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_lib/src/files/db/mod.rs:1176` calls `column_position_by_name`, `unwrap_or_default` and `rpfm_lib/src/files/db/mod.rs:1010` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) rpfm_lib/src/files/db/mod.rs:886 — rpfm_lib/src/files/db/mod.rs:886-891 | rpfm_lib/src/files/db/mod.rs:1176-1181 | rpfm_lib/src/files/db/mod.rs:1300-1305 | rpfm_lib/src/files/db/mod.rs:1331-1336 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:886` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/db/mod.rs:883` calls `column_position_by_name`, `unwrap_or_default` and `rpfm_lib/src/files/db/mod.rs:1173` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
IC1 · Incompleteness & stubs · Hollow method · ×2
  • Hollow method — returns a constant without doing the work rpfm_lib/src/files/rigidmodel/materials/rs_river.rs:18 — `read_rs_river` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work rpfm_lib/src/files/rigidmodel/materials/rs_river.rs:21 — `write_rs_river` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
D1 · Cyclomatic Complexity · PackFileContentsSlots · ×1
  • PackFileContentsSlots::new (cyclomatic 266) rpfm_ui/src/packfile_contents_ui/slots.rs:181 — PackFileContentsSlots::new has cyclomatic complexity 266 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppUISlots · ×1
  • AppUISlots::new (cyclomatic 146) rpfm_ui/src/app_ui/slots.rs:475 — AppUISlots::new has cyclomatic complexity 146 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableViewSlots · ×1
  • TableViewSlots::new (cyclomatic 104) rpfm_ui/src/views/table/slots.rs:122 — TableViewSlots::new has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ESFDetailedView · ×1
  • ESFDetailedView::save_from_detailed_view (cyclomatic 99) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:774 — ESFDetailedView::save_from_detailed_view has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Matches · ×1
  • Matches::find_matches (cyclomatic 71) rpfm_extensions/src/search/mod.rs:924 — Matches::find_matches has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Diagnostics · ×1
  • Diagnostics::check (cyclomatic 54) rpfm_extensions/src/diagnostics/mod.rs:314 — Diagnostics::check has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TextDiagnostic · ×1
  • TextDiagnostic::check (cyclomatic 52) rpfm_extensions/src/diagnostics/text.rs:148 — TextDiagnostic::check has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RawTable · ×1
  • RawTable::to_table (cyclomatic 45) rpfm_lib/src/integrations/assembly_kit/table_data.rs:403 — RawTable::to_table has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Table · ×1
  • Table::new_row (cyclomatic 40) rpfm_lib/src/files/table/mod.rs:279 — Table::new_row has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackedFileDecoderViewSlots · ×1
  • PackedFileDecoderViewSlots::new (cyclomatic 37) rpfm_ui/src/packedfile_views/decoder/slots.rs:105 — PackedFileDecoderViewSlots::new has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnimFragmentBattleDiagnostic · ×1
  • AnimFragmentBattleDiagnostic::check (cyclomatic 33) rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:118 — AnimFragmentBattleDiagnostic::check has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackTranslation · ×1
  • PackTranslation::new (cyclomatic 33) rpfm_extensions/src/translator/mod.rs:277 — PackTranslation::new has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GroupFormationsSlots · ×1
  • GroupFormationsSlots::new (cyclomatic 32) rpfm_ui/src/packedfile_views/group_formations/slots.rs:111 — GroupFormationsSlots::new has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Diplomacy · ×1
  • Diplomacy::new (cyclomatic 30) rpfm_extensions/src/startpos/world/diplomacy.rs:119 — Diplomacy::new has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UI · ×1
  • UI::finish_online_init (cyclomatic 28) rpfm_ui/src/ui/mod.rs:215 — UI::finish_online_init has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PortraitSettings · ×1
  • PortraitSettings::search (cyclomatic 26) rpfm_extensions/src/search/portrait_settings.rs:79 — PortraitSettings::search has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · RigidModel · ×1
  • RigidModel::search (cyclomatic 26) rpfm_extensions/src/search/rigid_model.rs:90 — RigidModel::search has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · Checker · ×1
  • Checker::follow_chain (cyclomatic 23) rpfm_extensions/src/lua/check.rs:306 — Checker::follow_chain has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchOn · ×1
  • SearchOn::types_to_search (cyclomatic 23) rpfm_extensions/src/search/mod.rs:861 — SearchOn::types_to_search has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: GlobalSearch::replace_possible (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TableInMemory · ×1
  • TableInMemory::tsv_import (cyclomatic 22) rpfm_lib/src/files/table/local.rs:358 — TableInMemory::tsv_import has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ManagerContext · ×1
  • ManagerContext::write_desire (cyclomatic 21) rpfm_extensions/src/startpos/cai/managers.rs:394 — ManagerContext::write_desire has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StartingStances · ×1
  • StartingStances::new (cyclomatic 20) rpfm_extensions/src/startpos/cai/stances.rs:80 — StartingStances::new has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CampaignIndex · ×1
  • CampaignIndex::new (cyclomatic 19) rpfm_extensions/src/startpos/world/mod.rs:267 — CampaignIndex::new has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnimFragmentBattleMatch · ×1
  • AnimFragmentBattleMatch::replace (cyclomatic 18) rpfm_extensions/src/search/anim_fragment_battle.rs:583 — AnimFragmentBattleMatch::replace has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container · ×1
  • Container::extract (cyclomatic 18) rpfm_lib/src/files/mod.rs:914 — Container::extract has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: FileType::from (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Field · ×1
  • Field::from (cyclomatic 18) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:695 — Field::from has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsUISlots · ×1
  • SettingsUISlots::new (cyclomatic 18) rpfm_ui/src/settings_ui/slots.rs:79 — SettingsUISlots::new has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PortraitSettingsDiagnostic · ×1
  • PortraitSettingsDiagnostic::check (cyclomatic 17) rpfm_extensions/src/diagnostics/portrait_settings.rs:118 — PortraitSettingsDiagnostic::check has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionState · ×1
  • SessionState::import_dependencies (cyclomatic 17) rpfm_server/src/state/files.rs:789 — SessionState::import_dependencies has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DependenciesUISlots · ×1
  • DependenciesUISlots::new (cyclomatic 17) rpfm_ui/src/dependencies_ui/slots.rs:72 — DependenciesUISlots::new has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PortraitSettingsSlots · ×1
  • PortraitSettingsSlots::new (cyclomatic 17) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:73 — PortraitSettingsSlots::new has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rpfm_extensions · ×1
  • rpfm_extensions::startpos::world::availability::available_chains (cyclomatic 16) rpfm_extensions/src/startpos/world/availability.rs:43 — rpfm_extensions::startpos::world::availability::available_chains has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Settings · ×1
  • Settings::init (cyclomatic 16) rpfm_ipc/src/settings.rs:152 — Settings::init has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GroupFormation · ×1
  • GroupFormation::validate (cyclomatic 16) rpfm_lib/src/files/group_formations/validation.rs:122 — GroupFormation::validate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Schema · ×1
  • Schema::tables_and_columns_referencing_our_own (cyclomatic 16) rpfm_lib/src/schema/mod.rs:1229 — Schema::tables_and_columns_referencing_our_own has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RigidModelView · ×1
  • RigidModelView::change_selected_row (cyclomatic 16) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:444 — RigidModelView::change_selected_row 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.
D2 · Cognitive Complexity · PackFileContentsSlots · ×1
  • PackFileContentsSlots::new (cognitive 559) rpfm_ui/src/packfile_contents_ui/slots.rs:181 — PackFileContentsSlots::new has cognitive complexity 559 (threshold 15). Drivers by points: if/else 157 (341 pts), loops 39 (122 pts), match/switch 39 (72 pts), boolean chains 24 (nesting depth added 300). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TextDiagnostic · ×1
  • TextDiagnostic::check (cognitive 290) rpfm_extensions/src/diagnostics/text.rs:148 — TextDiagnostic::check has cognitive complexity 290 (threshold 15). Drivers by points: if/else 45 (214 pts), loops 10 (58 pts), match/switch 3 (15 pts), boolean chains 3 (nesting depth added 229). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TableViewSlots · ×1
  • TableViewSlots::new (cognitive 289) rpfm_ui/src/views/table/slots.rs:122 — TableViewSlots::new has cognitive complexity 289 (threshold 15). Drivers by points: if/else 82 (230 pts), loops 6 (25 pts), match/switch 6 (24 pts), boolean chains 10 (nesting depth added 185). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ESFDetailedView · ×1
  • ESFDetailedView::save_from_detailed_view (cognitive 279) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:774 — ESFDetailedView::save_from_detailed_view has cognitive complexity 279 (threshold 15). Drivers by points: if/else 78 (273 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 198). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AppUISlots · ×1
  • AppUISlots::new (cognitive 187) rpfm_ui/src/app_ui/slots.rs:475 — AppUISlots::new has cognitive complexity 187 (threshold 15). Drivers by points: if/else 82 (124 pts), match/switch 18 (36 pts), loops 10 (17 pts), boolean chains 10 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Matches · ×1
  • Matches::find_matches (cognitive 126) rpfm_extensions/src/search/mod.rs:924 — Matches::find_matches has cognitive complexity 126 (threshold 15). Drivers by points: if/else 69 (102 pts), boolean chains 24 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnimFragmentBattleDiagnostic · ×1
  • AnimFragmentBattleDiagnostic::check (cognitive 90) rpfm_extensions/src/diagnostics/anim_fragment_battle.rs:118 — AnimFragmentBattleDiagnostic::check has cognitive complexity 90 (threshold 15). Drivers by points: if/else 20 (73 pts), boolean chains 12, loops 2 (5 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Table · ×1
  • Table::new_row (cognitive 83) rpfm_lib/src/files/table/mod.rs:279 — Table::new_row has cognitive complexity 83 (threshold 15). Drivers by points: if/else 48 (82 pts), match/switch 1 (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PortraitSettings · ×1
  • PortraitSettings::search (cognitive 81) rpfm_extensions/src/search/portrait_settings.rs:79 — PortraitSettings::search has cognitive complexity 81 (threshold 15). Drivers by points: loops 20 (70 pts), if/else 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 55). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PackedFileDecoderViewSlots · ×1
  • PackedFileDecoderViewSlots::new (cognitive 75) rpfm_ui/src/packedfile_views/decoder/slots.rs:105 — PackedFileDecoderViewSlots::new has cognitive complexity 75 (threshold 15). Drivers by points: if/else 37 (63 pts), loops 7, match/switch 3, boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawTable · ×1
  • RawTable::to_table (cognitive 68) rpfm_lib/src/integrations/assembly_kit/table_data.rs:403 — RawTable::to_table has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (46 pts), match/switch 3 (13 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackTranslation · ×1
  • PackTranslation::new (cognitive 56) rpfm_extensions/src/translator/mod.rs:277 — PackTranslation::new has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 6, loops 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RigidModelView · ×1
  • RigidModelView::change_selected_row (cognitive 51) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:444 — RigidModelView::change_selected_row has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (43 pts), match/switch 4 (8 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Diplomacy · ×1
  • Diplomacy::new (cognitive 47) rpfm_extensions/src/startpos/world/diplomacy.rs:119 — Diplomacy::new has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 10 (16 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StartingStances · ×1
  • StartingStances::new (cognitive 40) rpfm_extensions/src/startpos/cai/stances.rs:80 — StartingStances::new has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 6 (13 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Settings · ×1
  • Settings::init (cognitive 40) rpfm_ipc/src/settings.rs:152 — Settings::init has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortraitSettingsDiagnostic · ×1
  • PortraitSettingsDiagnostic::check (cognitive 39) rpfm_extensions/src/diagnostics/portrait_settings.rs:118 — PortraitSettingsDiagnostic::check has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UI · ×1
  • UI::finish_online_init (cognitive 35) rpfm_ui/src/ui/mod.rs:215 — UI::finish_online_init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (11 pts), match/switch 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UnitVariant · ×1
  • UnitVariant::search (cognitive 33) rpfm_extensions/src/search/unit_variant.rs:73 — UnitVariant::search has cognitive complexity 33 (threshold 15). Drivers by points: loops 10 (32 pts), match/switch 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GroupFormationsSlots · ×1
  • GroupFormationsSlots::new (cognitive 33) rpfm_ui/src/packedfile_views/group_formations/slots.rs:111 — GroupFormationsSlots::new has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30 (32 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RigidModelMatch · ×1
  • RigidModelMatch::replace (cognitive 32) rpfm_extensions/src/search/rigid_model.rs:439 — RigidModelMatch::replace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (32 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackDiagnostic · ×1
  • PackDiagnostic::check (cognitive 30) rpfm_extensions/src/diagnostics/pack.rs:107 — PackDiagnostic::check has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnimFragmentBattleMatch · ×1
  • AnimFragmentBattleMatch::replace (cognitive 30) rpfm_extensions/src/search/anim_fragment_battle.rs:583 — AnimFragmentBattleMatch::replace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (24 pts), match/switch 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CampaignIndex · ×1
  • CampaignIndex::new (cognitive 30) rpfm_extensions/src/startpos/world/mod.rs:267 — CampaignIndex::new has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 8 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackedFileAnimPackViewSlots · ×1
  • PackedFileAnimPackViewSlots::new (cognitive 29) rpfm_ui/src/packedfile_views/animpack/slots.rs:70 — PackedFileAnimPackViewSlots::new has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (9 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Text · ×1
  • Text::search (cognitive 27) rpfm_extensions/src/search/text.rs:77 — Text::search has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AreaGroups · ×1
  • AreaGroups::new (cognitive 26) rpfm_extensions/src/startpos/cai/map.rs:192 — AreaGroups::new has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (11 pts), boolean chains 3 (nesting depth added 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.
D2 · Cognitive Complexity · DependenciesUISlots · ×1
  • DependenciesUISlots::new (cognitive 26) rpfm_ui/src/dependencies_ui/slots.rs:72 — DependenciesUISlots::new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortraitSettingsSlots · ×1
  • PortraitSettingsSlots::new (cognitive 26) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:73 — PortraitSettingsSlots::new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionUI · ×1
  • SessionUI::populate_radio_buttons (cognitive 26) rpfm_ui/src/session_ui/mod.rs:205 — SessionUI::populate_radio_buttons has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForcePlan · ×1
  • ForcePlan::new (cognitive 25) rpfm_extensions/src/startpos/world/writer/forces.rs:158 — ForcePlan::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 6 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Field · ×1
  • Field::from (cognitive 25) rpfm_lib/src/integrations/assembly_kit/table_definition.rs:695 — Field::from has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackFileExtraViewSlots · ×1
  • PackFileExtraViewSlots::new (cognitive 25) rpfm_ui/src/packedfile_views/packfile/slots.rs:66 — PackFileExtraViewSlots::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CharacterWriter · ×1
  • CharacterWriter::family_links (cognitive 24) rpfm_extensions/src/startpos/world/writer/family.rs:87 — CharacterWriter::family_links has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DependenciesUI · ×1
  • DependenciesUI::import_dependencies (cognitive 24) rpfm_ui/src/dependencies_ui/mod.rs:222 — DependenciesUI::import_dependencies has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SearchOn · ×1
  • SearchOn::types_to_search (cognitive 22) rpfm_extensions/src/search/mod.rs:861 — SearchOn::types_to_search has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PortraitSettingsMatch · ×1
  • PortraitSettingsMatch::replace (cognitive 22) rpfm_extensions/src/search/portrait_settings.rs:398 — PortraitSettingsMatch::replace has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reader · ×1
  • Reader::faction (cognitive 22) rpfm_extensions/src/startpos/cai/world_view.rs:326 — Reader::faction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (7 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitIntegration · ×1
  • GitIntegration::update_repo (cognitive 22) rpfm_lib/src/integrations/git.rs:297 — GitIntegration::update_repo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GroupFormationsView · ×1
  • GroupFormationsView::load_blocks_tree (cognitive 22) rpfm_ui/src/packedfile_views/group_formations/mod.rs:843 — GroupFormationsView::load_blocks_tree has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (6 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortraitSettingsView · ×1
  • PortraitSettingsView::load_variant_image_to_label (cognitive 21) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:842 — PortraitSettingsView::load_variant_image_to_label has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 2 (5 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RegionMap · ×1
  • RegionMap::neighbour_pairs (cognitive 19) rpfm_extensions/src/startpos/region_map.rs:177 — RegionMap::neighbour_pairs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackSettings · ×1
  • PackSettings::diagnostics_files_to_ignore (cognitive 19) rpfm_lib/src/files/pack/mod.rs:1697 — PackSettings::diagnostics_files_to_ignore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReferencesUI · ×1
  • ReferencesUI::open_match (cognitive 19) rpfm_ui/src/references_ui/mod.rs:213 — ReferencesUI::open_match has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsUISlots · ×1
  • SettingsUISlots::new (cognitive 19) rpfm_ui/src/settings_ui/slots.rs:79 — SettingsUISlots::new has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 8 (9 pts), if/else 5 (7 pts), loops 3 (nesting depth added 3). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SearchData · ×1
  • SearchData::find_in_column (cognitive 19) rpfm_ui/src/views/table/search/mod.rs:691 — SearchData::find_in_column has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · References · ×1
  • References::new (cognitive 18) rpfm_extensions/src/startpos/extract/compare.rs:266 — References::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CaiPlan · ×1
  • CaiPlan::new (cognitive 17) rpfm_extensions/src/startpos/cai/plan.rs:277 — CaiPlan::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Image · ×1
  • Image::decode (cognitive 17) rpfm_lib/src/files/image/mod.rs:139 — Image::decode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UnitVariantSlots · ×1
  • UnitVariantSlots::new (cognitive 17) rpfm_ui/src/packedfile_views/unit_variant/slots.rs:69 — UnitVariantSlots::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SubToolVariantUnitEditor · ×1
  • SubToolVariantUnitEditor::load_variant_mesh (cognitive 17) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:553 — SubToolVariantUnitEditor::load_variant_mesh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFunctions · ×1
  • TooManyFunctions: rpfm_ui::settings_ui::backend rpfm_ui/src/settings_ui/backend.rs:52 — TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: slots.rs → tips.rs, slots.rs, mod.rs rpfm_ui/src/app_ui/slots.rs — `rpfm_ui/src/app_ui/slots.rs` changes together with 3 other files — `rpfm_ui/src/app_ui/tips.rs`, `rpfm_ui/src/packedfile_views/packfile/slots.rs`, `rpfm_ui/src/welcome_page_ui/mod.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (8 members, 64 shared lines) · ×1
  • Near-duplicate member family (8 members, 64 shared lines) rpfm_ui/src/global_search_ui/mod.rs:1193 — rpfm_ui/src/global_search_ui/mod.rs:1193-1334 | rpfm_ui/src/global_search_ui/mod.rs:1337-1418 | rpfm_ui/src/global_search_ui/mod.rs:1421-1553 | rpfm_ui/src/global_search_ui/mod.rs:1556-1692 | rpfm_ui/src/global_search_ui/mod.rs:1695-1778 | rpfm_ui/src/global_search_ui/mod.rs:1781-1861 | rpfm_ui/src/global_search_ui/mod.rs:1864-1981 | rpfm_ui/src/global_search_ui/mod.rs:1984-2061 — These 8 members are variants of one another: a block of 64 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 16 shared lines) · ×1
  • Near-duplicate member family (3 members, 16 shared lines) rpfm_ui/src/tools/faction_painter/mod.rs:930 — rpfm_ui/src/tools/faction_painter/mod.rs:930-995 | rpfm_ui/src/tools/faction_painter/mod.rs:998-1060 | rpfm_ui/src/tools/faction_painter/mod.rs:1063-1126 — These 3 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (102 shared lines) · ×1
  • Near-duplicate member pair (102 shared lines) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:73 — rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:73-309 | rpfm_ui/src/packedfile_views/unit_variant/slots.rs:69-263 — These two members are variants of one another: 102 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (68 shared lines) · ×1
  • Near-duplicate member pair (68 shared lines) rpfm_ui/src/tools/mod.rs:676 — rpfm_ui/src/tools/mod.rs:676-857 | rpfm_ui/src/tools/mod.rs:1040-1133 — These two members are variants of one another: 68 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (20 shared lines) · ×1
  • Near-duplicate member pair (20 shared lines) rpfm_ui/src/views/table/mod.rs:2630 — rpfm_ui/src/views/table/mod.rs:2630-2693 | rpfm_ui/src/views/table/mod.rs:2698-2763 — These two members are variants of one another: 20 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (37 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (37 members, 50+ identical tokens) rpfm_lib/src/files/bmd/ai_hints/directed_points/mod.rs:38 — rpfm_lib/src/files/bmd/ai_hints/directed_points/mod.rs:38-48 | rpfm_lib/src/files/bmd/ai_hints/mod.rs:50-60 | rpfm_lib/src/files/bmd/ai_hints/polylines/mod.rs:41-51 | rpfm_lib/src/files/bmd/ai_hints/polylines_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/ai_hints/separators/mod.rs:41-51 | rpfm_lib/src/files/bmd/ai_hints/separators/separator/mod.rs:39-49 | rpfm_lib/src/files/bmd/battlefield_building_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/battlefield_building_list_far/mod.rs:38-48 | rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:41-51 | rpfm_lib/src/files/bmd/bmd_catchment_area_list/mod.rs:40-50 | rpfm_lib/src/files/bmd/bmd_outline_list/mod.rs:38-48 | rpfm_lib/src/files/bmd/building_projectile_emitter_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/camera_zones/mod.rs:38-48 | rpfm_lib/src/files/bmd/common/building_reference/mod.rs:80-90 | rpfm_lib/src/files/bmd/composite_scene_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/custom_material_mesh_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/deployment_region/boundary/mod.rs:39-49 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/deployment_region/mod.rs:44-54 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/mod.rs:41-51 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/mod.rs:42-52 | rpfm_lib/src/files/bmd/deployment_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/grass_list_reference_list/mod.rs:38-48 | rpfm_lib/src/files/bmd/light_probe_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:68-78 | rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs:41-51 | rpfm_lib/src/files/bmd/point_light_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/prefab_instance_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/sound_shape_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/river_node/mod.rs:40-50 | rpfm_lib/src/files/bmd/spot_light_list/mod.rs:41-51 | rpfm_lib/src/files/bmd/terrain_decal_list/mod.rs:38-48 | rpfm_lib/src/files/bmd/terrain_stencil_blend_triangle_list/mod.rs:38-48 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/mod.rs:41-51 | rpfm_lib/src/files/tile_database/conversion_params/mod.rs:76-86 | rpfm_lib/src/files/tile_database/tile_link/mod.rs:69-79 | rpfm_lib/src/files/tile_database/tile_link_target/mod.rs:54-64 | rpfm_lib/src/files/tile_database/tile_set/mod.rs:64-74 — These 37 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 37 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 37 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) rpfm_ui/src/app_ui/mod.rs:382 — rpfm_ui/src/app_ui/mod.rs:382-886 | rpfm_ui/src/app_ui/slots.rs:482-2020 | rpfm_ui/src/diagnostics_ui/mod.rs:246-574 | rpfm_ui/src/packedfile_views/decoder/slots.rs:109-674 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:111-693 | rpfm_ui/src/packfile_contents_ui/slots.rs:188-2621 | rpfm_ui/src/tools/unit_editor/mod.rs:209-454 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:154-309 | rpfm_ui/src/views/table/slots.rs:131-1057 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rpfm_ui/src/dependencies_ui/mod.rs:111 — rpfm_ui/src/dependencies_ui/mod.rs:111-193 | rpfm_ui/src/packedfile_views/animpack/mod.rs:110-210 | rpfm_ui/src/packedfile_views/esf/mod.rs:107-188 | rpfm_ui/src/packedfile_views/packfile/mod.rs:100-159 | rpfm_ui/src/packfile_contents_ui/mod.rs:201-540 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) rpfm_ui/src/tools/faction_painter/mod.rs:762 — rpfm_ui/src/tools/faction_painter/mod.rs:762-843 | rpfm_ui/src/tools/faction_painter/mod.rs:846-927 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (107 corresponding lines) · ×1
  • Edited copy of a member (107 corresponding lines) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:444 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:444-550 | rpfm_ui/src/tools/translator/mod.rs:980-1089 — These two members are one piece of code written twice and then edited apart: 107 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) rpfm_lib/src/files/mod.rs:1902 — rpfm_lib/src/files/mod.rs:1902-1965 | rpfm_lib/src/files/pack/mod.rs:485-551 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) rpfm_ui/src/packedfile_views/portrait_settings/connections.rs:25 — rpfm_ui/src/packedfile_views/portrait_settings/connections.rs:25-58 | rpfm_ui/src/packedfile_views/unit_variant/connections.rs:25-50 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) rpfm_ui/src/packfile_contents_ui/mod.rs:551 — rpfm_ui/src/packfile_contents_ui/mod.rs:551-601 | rpfm_ui/src/packfile_contents_ui/mod.rs:800-846 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) rpfm_extensions/src/dependencies/mod.rs:2189 — rpfm_extensions/src/dependencies/mod.rs:2189-2212 | rpfm_extensions/src/dependencies/mod.rs:2246-2273 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) rpfm_ui/src/tools/unit_editor/mod.rs:553 — rpfm_ui/src/tools/unit_editor/mod.rs:553-598 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:405-449 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) rpfm_ui/src/tools/unit_editor/mod.rs:656 — rpfm_ui/src/tools/unit_editor/mod.rs:656-693 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:620-664 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) rpfm_lib/src/files/rigidmodel/materials/mod.rs:586 — rpfm_lib/src/files/rigidmodel/materials/mod.rs:586-635 | rpfm_lib/src/files/rigidmodel/materials/mod.rs:646-697 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) rpfm_extensions/src/merge/mod.rs:109 — rpfm_extensions/src/merge/mod.rs:109-144 | rpfm_extensions/src/merge/mod.rs:148-177 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) rpfm_lib/src/files/asset_variation_db/mod.rs:368 — rpfm_lib/src/files/asset_variation_db/mod.rs:368-399 | rpfm_lib/src/files/asset_variation_db/mod.rs:486-510 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:314 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:314-358 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:484-510 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) rpfm_ui/src/tools/faction_painter/mod.rs:479 — rpfm_ui/src/tools/faction_painter/mod.rs:479-492 | rpfm_ui/src/tools/faction_painter/mod.rs:498-511 | rpfm_ui/src/tools/faction_painter/mod.rs:514-527 | rpfm_ui/src/tools/faction_painter/mod.rs:533-546 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) rpfm_extensions/src/dependencies/mod.rs:1388 — rpfm_extensions/src/dependencies/mod.rs:1388-1429 | rpfm_extensions/src/dependencies/mod.rs:1437-1493 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) rpfm_lib/src/binary/reader.rs:657 — rpfm_lib/src/binary/reader.rs:657-704 | rpfm_lib/src/binary/reader.rs:866-917 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) rpfm_lib/src/integrations/assembly_kit/mod.rs:424 — rpfm_lib/src/integrations/assembly_kit/mod.rs:424-458 | rpfm_lib/src/integrations/assembly_kit/mod.rs:478-510 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) rpfm_lib/src/files/tile_database/assembly_kit.rs:213 — rpfm_lib/src/files/tile_database/assembly_kit.rs:213-231 | rpfm_lib/src/files/tile_database/assembly_kit.rs:248-264 | rpfm_lib/src/files/tile_database/assembly_kit.rs:311-328 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) rpfm_extensions/src/dependencies/mod.rs:1300 — rpfm_extensions/src/dependencies/mod.rs:1300-1319 | rpfm_extensions/src/dependencies/mod.rs:1322-1341 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) rpfm_lib/src/games/mod.rs:1465 — rpfm_lib/src/games/mod.rs:1465-1493 | rpfm_lib/src/games/mod.rs:1519-1547 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) rpfm_extensions/src/startpos/cai/factions.rs:289 — rpfm_extensions/src/startpos/cai/factions.rs:289-303 | rpfm_extensions/src/startpos/cai/factions.rs:316-334 | rpfm_extensions/src/startpos/cai/lists.rs:218-230 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:555 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:555-572 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:281-302 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) rpfm_lib/src/integrations/assembly_kit/mod.rs:529 — rpfm_lib/src/integrations/assembly_kit/mod.rs:529-550 | rpfm_lib/src/integrations/assembly_kit/mod.rs:569-590 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) rpfm_ui/src/app_ui/mod.rs:1138 — rpfm_ui/src/app_ui/mod.rs:1138-1168 | rpfm_ui/src/app_ui/mod.rs:1176-1214 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) rpfm_lib/src/schema/mod.rs:610 — rpfm_lib/src/schema/mod.rs:610-623 | rpfm_lib/src/schema/mod.rs:639-652 | rpfm_lib/src/schema/mod.rs:669-687 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) rpfm_lib/src/files/anim_fragment_battle/mod.rs:540 — rpfm_lib/src/files/anim_fragment_battle/mod.rs:540-563 | rpfm_lib/src/files/anim_fragment_battle/mod.rs:568-585 | rpfm_lib/src/files/matched_combat/mod.rs:267-288 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) rpfm_lib/src/files/bmd/capture_location_set/mod.rs:73 — rpfm_lib/src/files/bmd/capture_location_set/mod.rs:73-88 | rpfm_lib/src/files/bmd/common/properties/mod.rs:184-197 | rpfm_lib/src/files/bmd/composite_scene_list/composite_scene_reference/mod.rs:52-65 | rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:54-69 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:59-73 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) rpfm_lib/src/files/bmd/capture_location_set/mod.rs:93 — rpfm_lib/src/files/bmd/capture_location_set/mod.rs:93-107 | rpfm_lib/src/files/bmd/common/properties/mod.rs:202-214 | rpfm_lib/src/files/bmd/composite_scene_list/composite_scene_reference/mod.rs:70-82 | rpfm_lib/src/files/bmd/particle_emitter_list/particle_emitter/mod.rs:74-88 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/mod.rs:78-91 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) rpfm_ui/src/packedfile_views/anims_table/mod.rs:41 — rpfm_ui/src/packedfile_views/anims_table/mod.rs:41-59 | rpfm_ui/src/packedfile_views/group_formations/mod.rs:1322-1338 | rpfm_ui/src/packedfile_views/matched_combat/mod.rs:41-59 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:608-626 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:41 — rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:41-52 | rpfm_lib/src/files/bmd/common/building_link/mod.rs:108-120 | rpfm_lib/src/files/bmd/tree_list_reference_list/mod.rs:40-52 | rpfm_lib/src/files/bmd/zones_template_list/mod.rs:42-53 | rpfm_lib/src/files/bmd_vegetation/grass_list/mod.rs:107-118 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) rpfm_ui/src/dependencies_ui/mod.rs:196 — rpfm_ui/src/dependencies_ui/mod.rs:196-214 | rpfm_ui/src/packedfile_views/esf/mod.rs:206-224 | rpfm_ui/src/packedfile_views/packfile/mod.rs:162-179 | rpfm_ui/src/packfile_contents_ui/mod.rs:604-622 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:57 — rpfm_lib/src/files/bmd/ai_hints/polylines_list/hint_polyline/mod.rs:57-67 | rpfm_lib/src/files/bmd/common/building_link/mod.rs:125-136 | rpfm_lib/src/files/bmd/tree_list_reference_list/mod.rs:57-68 | rpfm_lib/src/files/bmd/zones_template_list/mod.rs:58-68 | rpfm_lib/src/files/bmd_vegetation/grass_list/mod.rs:123-133 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:45 — rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/mod.rs:45-55 | rpfm_lib/src/files/bmd/prefab_instance_list/prefab_instance/mod.rs:50-62 | rpfm_lib/src/files/tile_database/render_params/mod.rs:102-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 11+ corresponding lines) rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:43 — rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:43-54 | rpfm_lib/src/files/bmd/custom_material_mesh_list/custom_material_mesh/mod.rs:51-63 | rpfm_lib/src/files/bmd/playable_area/mod.rs:44-55 | rpfm_lib/src/files/bmd/prop_list/mod.rs:70-80 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/terrain_stencil_triangle/mod.rs:43-54 | rpfm_lib/src/files/tile_database/tile_variation/mod.rs:76-86 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) rpfm_lib/src/files/bmd_vegetation/mod.rs:191 — rpfm_lib/src/files/bmd_vegetation/mod.rs:191-201 | rpfm_lib/src/files/hlsl_compiled/mod.rs:163-173 | rpfm_lib/src/files/tile_database/mod.rs:134-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) rpfm_ui/src/tools/mod.rs:861 — rpfm_ui/src/tools/mod.rs:861-869 | rpfm_ui/src/tools/mod.rs:873-884 | rpfm_ui/src/tools/mod.rs:888-899 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) rpfm_lib/src/games/mod.rs:682 — rpfm_lib/src/games/mod.rs:682-686 | rpfm_lib/src/games/mod.rs:835-839 | rpfm_lib/src/games/mod.rs:1011-1017 | rpfm_lib/src/games/mod.rs:1038-1047 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) rpfm_extensions/src/startpos/layout.rs:641 — rpfm_extensions/src/startpos/layout.rs:641-648 | rpfm_extensions/src/startpos/layout.rs:655-662 | rpfm_extensions/src/startpos/layout.rs:669-676 | rpfm_extensions/src/startpos/layout.rs:696-703 | rpfm_extensions/src/startpos/layout.rs:710-717 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 10+ corresponding lines) rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:59 — rpfm_lib/src/files/bmd/building_projectile_emitter_list/building_projectile_emitter/mod.rs:59-69 | rpfm_lib/src/files/bmd/light_probe_list/light_probe/mod.rs:58-67 | rpfm_lib/src/files/bmd/playable_area/mod.rs:60-70 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/terrain_stencil_triangle/mod.rs:59-69 | rpfm_lib/src/files/bmd/toggleable_buildings_slot_list/toggleable_building_slot/building_link/mod.rs:57-66 | rpfm_lib/src/files/tile_database/climate/mod.rs:83-92 | rpfm_lib/src/files/tile_database/tile/mod.rs:108-117 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) rpfm_lib/src/integrations/github/mod.rs:370 — rpfm_lib/src/integrations/github/mod.rs:370-374 | rpfm_lib/src/integrations/github/mod.rs:388-392 | rpfm_lib/src/integrations/github/mod.rs:407-411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (32–49 lines × 5) · ×1
  • Duplicated block (32–49 lines × 5) rpfm_ui/src/app_ui/slots.rs:1899 — rpfm_ui/src/app_ui/slots.rs:1899-1947 | rpfm_ui/src/packedfile_views/decoder/slots.rs:628-664 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:644-677 | rpfm_ui/src/packfile_contents_ui/slots.rs:2534-2570 | rpfm_ui/src/views/table/slots.rs:1006-1037 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/packedfile_views/decoder/slots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 240 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1899` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (40–42 lines × 8) · ×1
  • Duplicated block (40–42 lines × 8) rpfm_ui/src/global_search_ui/mod.rs:1194 — rpfm_ui/src/global_search_ui/mod.rs:1194-1234 | rpfm_ui/src/global_search_ui/mod.rs:1338-1377 | rpfm_ui/src/global_search_ui/mod.rs:1422-1462 | rpfm_ui/src/global_search_ui/mod.rs:1557-1596 | rpfm_ui/src/global_search_ui/mod.rs:1696-1737 | rpfm_ui/src/global_search_ui/mod.rs:1782-1823 | rpfm_ui/src/global_search_ui/mod.rs:1865-1905 | rpfm_ui/src/global_search_ui/mod.rs:1985-2026 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/global_search_ui/mod.rs:1194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `matches` to `&[AnimFragmentBattleMatches]` in one and `&[AtlasMatches]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) rpfm_extensions/src/diagnostics/text.rs:242 — rpfm_extensions/src/diagnostics/text.rs:242-283 | rpfm_extensions/src/diagnostics/text.rs:287-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/diagnostics/text.rs:242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) rpfm_lib/src/files/mod.rs:1927 — rpfm_lib/src/files/mod.rs:1927-1965 | rpfm_lib/src/files/pack/mod.rs:513-551 — 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 `rpfm_lib/src/files/mod.rs:1927` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:124 — rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:124-189 | rpfm_ui/src/packedfile_views/unit_variant/slots.rs:120-185 — `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs` and `rpfm_ui/src/packedfile_views/unit_variant/slots.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/slots.rs:124` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&Arc<PortraitSettingsView>` in one and `&Arc<UnitVariantView>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) rpfm_lib/src/files/mod.rs:944 — rpfm_lib/src/files/mod.rs:944-980 | rpfm_lib/src/files/mod.rs:1000-1037 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/mod.rs:944` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/mod.rs:941` calls `files_mut`, `get_mut`, `ok_or_else` and `rpfm_lib/src/files/mod.rs:997` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) rpfm_ui/src/diagnostics_ui/mod.rs:482 — rpfm_ui/src/diagnostics_ui/mod.rs:482-515 | rpfm_ui/src/tools/unit_editor/mod.rs:380-424 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:237-271 — before extracting anything, compare `rpfm_ui/src/diagnostics_ui/mod.rs` and `rpfm_ui/src/tools/unit_editor/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) rpfm_ui/src/packedfile_views/group_formations/mod.rs:488 — rpfm_ui/src/packedfile_views/group_formations/mod.rs:488-521 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:450-485 — 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 `rpfm_ui/src/packedfile_views/group_formations/mod.rs:488` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 8) · ×1
  • Duplicated block (33 lines × 8) rpfm_ui/src/app_ui/mod.rs:736 — rpfm_ui/src/app_ui/mod.rs:736-780 | rpfm_ui/src/app_ui/slots.rs:1904-1957 | rpfm_ui/src/diagnostics_ui/mod.rs:482-517 | rpfm_ui/src/packedfile_views/decoder/slots.rs:632-667 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:647-679 | rpfm_ui/src/packfile_contents_ui/slots.rs:2538-2572 | rpfm_ui/src/tools/unit_editor/mod.rs:380-426 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:237-274 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/diagnostics_ui/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:455 — rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:455-487 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:218-250 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–32 lines × 3) · ×1
  • Duplicated block (14–32 lines × 3) rpfm_extensions/src/gltf/mod.rs:271 — rpfm_extensions/src/gltf/mod.rs:271-302 | rpfm_extensions/src/gltf/mod.rs:306-319 | rpfm_extensions/src/gltf/mod.rs:323-336 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/gltf/mod.rs:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) rpfm_ui/src/global_search_ui/mod.rs:530 — rpfm_ui/src/global_search_ui/mod.rs:530-561 | rpfm_ui/src/packfile_contents_ui/mod.rs:432-471 — 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 `rpfm_ui/src/global_search_ui/mod.rs:530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 5) · ×1
  • Duplicated block (31 lines × 5) rpfm_ui/src/app_ui/slots.rs:1980 — rpfm_ui/src/app_ui/slots.rs:1980-2020 | rpfm_ui/src/packedfile_views/decoder/slots.rs:638-674 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:659-693 | rpfm_ui/src/packfile_contents_ui/slots.rs:2588-2621 | rpfm_ui/src/views/table/slots.rs:1027-1057 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/packedfile_views/decoder/slots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 240 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1980` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) rpfm_ui/src/app_ui/slots.rs:315 — rpfm_ui/src/app_ui/slots.rs:315-344 | rpfm_ui/src/views/table/mod.rs:3249-3279 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/views/table/mod.rs:3281` calls `update_row_diff_marker`, `row` and `rpfm_ui/src/app_ui/slots.rs:345` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (30 lines × 8) · ×1
  • Duplicated block (30 lines × 8) rpfm_ui/src/app_ui/slots.rs:1902 — rpfm_ui/src/app_ui/slots.rs:1902-1952 | rpfm_ui/src/diagnostics_ui/mod.rs:482-516 | rpfm_ui/src/packedfile_views/decoder/slots.rs:631-666 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:646-678 | rpfm_ui/src/packfile_contents_ui/slots.rs:2537-2571 | rpfm_ui/src/tools/unit_editor/mod.rs:380-425 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:237-272 | rpfm_ui/src/views/table/slots.rs:1009-1038 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/diagnostics_ui/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1902` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30 lines × 7) · ×1
  • Duplicated block (30 lines × 7) rpfm_ui/src/app_ui/slots.rs:1980 — rpfm_ui/src/app_ui/slots.rs:1980-2019 | rpfm_ui/src/packedfile_views/decoder/slots.rs:638-673 | rpfm_ui/src/packedfile_views/group_formations/slots.rs:659-692 | rpfm_ui/src/packfile_contents_ui/slots.rs:2588-2620 | rpfm_ui/src/tools/unit_editor/mod.rs:386-430 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:250-286 | rpfm_ui/src/views/table/slots.rs:1027-1056 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/packedfile_views/decoder/slots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 240 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:1980` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/tools/unit_editor/mod.rs:434` calls `setup_widgets_relations` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:290` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–29 lines × 7) · ×1
  • Duplicated block (11–29 lines × 7) rpfm_extensions/src/gltf/mod.rs:190 — rpfm_extensions/src/gltf/mod.rs:190-200 | rpfm_extensions/src/gltf/mod.rs:224-234 | rpfm_extensions/src/gltf/mod.rs:241-251 | rpfm_extensions/src/gltf/mod.rs:258-268 | rpfm_extensions/src/gltf/mod.rs:275-303 | rpfm_extensions/src/gltf/mod.rs:310-320 | rpfm_extensions/src/gltf/mod.rs:327-337 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/gltf/mod.rs:190` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10–28 lines × 8) · ×1
  • Duplicated block (10–28 lines × 8) rpfm_extensions/src/gltf/mod.rs:192 — rpfm_extensions/src/gltf/mod.rs:192-201 | rpfm_extensions/src/gltf/mod.rs:209-218 | rpfm_extensions/src/gltf/mod.rs:226-235 | rpfm_extensions/src/gltf/mod.rs:243-252 | rpfm_extensions/src/gltf/mod.rs:260-269 | rpfm_extensions/src/gltf/mod.rs:277-304 | rpfm_extensions/src/gltf/mod.rs:312-321 | rpfm_extensions/src/gltf/mod.rs:329-338 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/gltf/mod.rs:192` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (21–28 lines × 2) · ×1
  • Duplicated block (21–28 lines × 2) rpfm_extensions/src/dependencies/mod.rs:1349 — rpfm_extensions/src/dependencies/mod.rs:1349-1369 | rpfm_extensions/src/dependencies/mod.rs:1513-1540 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:1349` 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.
D4 · Code Duplication · Duplicated block (24 lines × 5) · ×1
  • Duplicated block (24 lines × 5) rpfm_server/src/ceo_builder.rs:381 — rpfm_server/src/ceo_builder.rs:381-404 | rpfm_server/src/ceo_builder.rs:472-495 | rpfm_server/src/ceo_builder.rs:554-577 | rpfm_server/src/ceo_builder.rs:647-670 | rpfm_server/src/ceo_builder.rs:730-753 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/ceo_builder.rs:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_server/src/ceo_builder.rs:380` calls `as_str` and `rpfm_server/src/ceo_builder.rs:553` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23 lines × 8) · ×1
  • Duplicated block (23 lines × 8) rpfm_ui/src/diagnostics_ui/mod.rs:763 — rpfm_ui/src/diagnostics_ui/mod.rs:763-785 | rpfm_ui/src/diagnostics_ui/mod.rs:812-834 | rpfm_ui/src/diagnostics_ui/mod.rs:861-883 | rpfm_ui/src/diagnostics_ui/mod.rs:921-943 | rpfm_ui/src/diagnostics_ui/mod.rs:981-1003 | rpfm_ui/src/diagnostics_ui/mod.rs:1033-1055 | rpfm_ui/src/diagnostics_ui/mod.rs:1086-1108 | rpfm_ui/src/diagnostics_ui/mod.rs:1135-1157 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:763` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) rpfm_server/src/ceo_builder.rs:241 — rpfm_server/src/ceo_builder.rs:241-261 | rpfm_server/src/ceo_builder.rs:1004-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:256 — rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:256-275 | rpfm_ui/src/packedfile_views/vmd/mod.rs:117-137 — 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 `rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:256` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packedfile_views/rigidmodel/mod.rs:277` calls `load_data` and `rpfm_ui/src/packedfile_views/vmd/mod.rs:139` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) rpfm_ui/src/views/table/search/mod.rs:236 — rpfm_ui/src/views/table/search/mod.rs:236-262 | rpfm_ui/src/views/table/search/mod.rs:338-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) rpfm_ui/src/views/table/mod.rs:751 — rpfm_ui/src/views/table/mod.rs:751-768 | rpfm_ui/src/views/table/mod.rs:774-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/views/table/mod.rs:769` calls `add_action_q_action` and `rpfm_ui/src/views/table/mod.rs:785` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) rpfm_extensions/src/dependencies/mod.rs:447 — rpfm_extensions/src/dependencies/mod.rs:447-463 | rpfm_extensions/src/dependencies/mod.rs:853-869 | rpfm_extensions/src/dependencies/mod.rs:934-950 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) rpfm_lib/src/files/esf/utils.rs:478 — rpfm_lib/src/files/esf/utils.rs:478-494 | rpfm_lib/src/files/esf/utils.rs:496-509 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/esf/utils.rs:478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:328 — rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:328-344 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:494-505 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) rpfm_ui_common/src/icons/mod.rs:272 — rpfm_ui_common/src/icons/mod.rs:272-288 | rpfm_ui_common/src/icons/mod.rs:398-413 — both copies are in the same file, so extract the 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 `rpfm_ui_common/src/icons/mod.rs:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) rpfm_extensions/src/dependencies/mod.rs:2669 — rpfm_extensions/src/dependencies/mod.rs:2669-2684 | rpfm_extensions/src/dependencies/mod.rs:2832-2843 — both copies are in the same file, so extract the 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 `rpfm_extensions/src/dependencies/mod.rs:2669` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:772 — rpfm_ui/src/tools/faction_painter/mod.rs:772-799 | rpfm_ui/src/tools/faction_painter/mod.rs:856-883 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:772` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–16 lines × 4) · ×1
  • Duplicated block (4–16 lines × 4) rpfm_ui/src/global_search_ui/mod.rs:1119 — rpfm_ui/src/global_search_ui/mod.rs:1119-1122 | rpfm_ui/src/references_ui/mod.rs:274-277 | rpfm_ui/src/views/table/mod.rs:3865-3879 | rpfm_ui/src/views/table/mod.rs:4109-4124 — before extracting anything, compare `rpfm_ui/src/references_ui/mod.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/mod.rs:3865` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/global_search_ui/mod.rs:1125` calls `child_2a`, `row`, `text` and `rpfm_ui/src/references_ui/mod.rs:280` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–15 lines × 7) · ×1
  • Duplicated block (11–15 lines × 7) rpfm_server/src/ceo_builder.rs:454 — rpfm_server/src/ceo_builder.rs:454-464 | rpfm_server/src/ceo_builder.rs:533-543 | rpfm_server/src/ceo_builder.rs:626-636 | rpfm_server/src/ceo_builder.rs:709-719 | rpfm_server/src/ceo_builder.rs:792-802 | rpfm_server/src/ceo_builder.rs:835-849 | rpfm_server/src/ceo_builder.rs:1109-1123 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/ceo_builder.rs:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 4) · ×1
  • Duplicated block (12–15 lines × 4) rpfm_extensions/src/dependencies/mod.rs:451 — rpfm_extensions/src/dependencies/mod.rs:451-462 | rpfm_extensions/src/dependencies/mod.rs:857-868 | rpfm_extensions/src/dependencies/mod.rs:938-949 | rpfm_lib/src/files/mod.rs:1807-1821 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:451` 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) rpfm_lib/src/files/mod.rs:2412 — rpfm_lib/src/files/mod.rs:2412-2426 | rpfm_lib/src/files/mod.rs:2430-2443 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/mod.rs:2430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 8) · ×1
  • Duplicated block (11–14 lines × 8) rpfm_server/src/ceo_builder.rs:456 — rpfm_server/src/ceo_builder.rs:456-466 | rpfm_server/src/ceo_builder.rs:535-545 | rpfm_server/src/ceo_builder.rs:628-638 | rpfm_server/src/ceo_builder.rs:711-721 | rpfm_server/src/ceo_builder.rs:794-804 | rpfm_server/src/ceo_builder.rs:838-851 | rpfm_server/src/ceo_builder.rs:1064-1074 | rpfm_server/src/ceo_builder.rs:1112-1125 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) rpfm_server/src/ceo_builder.rs:506 — rpfm_server/src/ceo_builder.rs:506-519 | rpfm_server/src/ceo_builder.rs:589-602 | rpfm_server/src/ceo_builder.rs:682-695 | rpfm_server/src/ceo_builder.rs:765-778 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_server/src/ceo_builder.rs:506` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) rpfm_ui/src/tools/faction_painter/mod.rs:655 — rpfm_ui/src/tools/faction_painter/mod.rs:655-668 | rpfm_ui/src/tools/faction_painter/mod.rs:794-807 | rpfm_ui/src/tools/faction_painter/mod.rs:878-891 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) rpfm_lib/src/games/mod.rs:915 — rpfm_lib/src/games/mod.rs:915-928 | rpfm_lib/src/games/mod.rs:948-959 — both copies are in the same file, so extract the 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 `rpfm_lib/src/games/mod.rs:915` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) rpfm_lib/src/games/supported_games.rs:1062 — rpfm_lib/src/games/supported_games.rs:1062-1074 | rpfm_lib/src/games/supported_games.rs:1362-1373 | rpfm_lib/src/games/supported_games.rs:1882-1893 | rpfm_lib/src/games/supported_games.rs:2159-2170 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:1062` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) rpfm_ui/src/app_ui/mod.rs:2308 — rpfm_ui/src/app_ui/mod.rs:2308-2320 | rpfm_ui/src/app_ui/mod.rs:2333-2345 | rpfm_ui/src/app_ui/mod.rs:2440-2452 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:2308` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 8) · ×1
  • Duplicated block (20 lines × 8) rpfm_ui/src/global_search_ui/mod.rs:1315 — rpfm_ui/src/global_search_ui/mod.rs:1315-1334 | rpfm_ui/src/global_search_ui/mod.rs:1399-1418 | rpfm_ui/src/global_search_ui/mod.rs:1534-1553 | rpfm_ui/src/global_search_ui/mod.rs:1673-1692 | rpfm_ui/src/global_search_ui/mod.rs:1759-1778 | rpfm_ui/src/global_search_ui/mod.rs:1842-1861 | rpfm_ui/src/global_search_ui/mod.rs:1962-1981 | rpfm_ui/src/global_search_ui/mod.rs:2042-2061 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/global_search_ui/mod.rs:1315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/global_search_ui/mod.rs:2039` calls `append_q_standard_item`, `new_item`, `into_ptr` and `rpfm_ui/src/global_search_ui/mod.rs:1396` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) rpfm_lib/src/games/supported_games.rs:437 — rpfm_lib/src/games/supported_games.rs:437-448 | rpfm_lib/src/games/supported_games.rs:636-647 | rpfm_lib/src/games/supported_games.rs:1065-1076 | rpfm_lib/src/games/supported_games.rs:1364-1375 | rpfm_lib/src/games/supported_games.rs:1884-1895 | rpfm_lib/src/games/supported_games.rs:2161-2172 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:437` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 6) · ×1
  • Duplicated block (11–12 lines × 6) rpfm_ui/src/diagnostics_ui/mod.rs:1533 — rpfm_ui/src/diagnostics_ui/mod.rs:1533-1543 | rpfm_ui/src/diagnostics_ui/mod.rs:1547-1557 | rpfm_ui/src/diagnostics_ui/mod.rs:1560-1571 | rpfm_ui/src/diagnostics_ui/mod.rs:1584-1594 | rpfm_ui/src/diagnostics_ui/mod.rs:1598-1608 | rpfm_ui/src/diagnostics_ui/mod.rs:1611-1622 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:1533` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–12 lines × 5) · ×1
  • Duplicated block (4–12 lines × 5) rpfm_ui/src/app_ui/mod.rs:1757 — rpfm_ui/src/app_ui/mod.rs:1757-1768 | rpfm_ui/src/app_ui/mod.rs:1781-1792 | rpfm_ui/src/app_ui/mod.rs:1805-1816 | rpfm_ui/src/app_ui/mod.rs:1837-1848 | rpfm_ui/src/app_ui/mod.rs:1995-1998 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:1757` 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.
D4 · Code Duplication · Duplicated block (5–12 lines × 5) · ×1
  • Duplicated block (5–12 lines × 5) rpfm_ui/src/app_ui/mod.rs:3578 — rpfm_ui/src/app_ui/mod.rs:3578-3589 | rpfm_ui/src/app_ui/mod.rs:3594-3605 | rpfm_ui/src/app_ui/mod.rs:3622-3633 | rpfm_ui/src/app_ui/mod.rs:3638-3649 | rpfm_ui/src/diagnostics_ui/mod.rs:2316-2320 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:3578` 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.
D4 · Code Duplication · Duplicated block (2–11 lines × 12) · ×1
  • Duplicated block (2–11 lines × 12) rpfm_ui/src/app_ui/slots.rs:436 — rpfm_ui/src/app_ui/slots.rs:436-438 | rpfm_ui/src/app_ui/slots.rs:446-448 | rpfm_ui/src/app_ui/slots.rs:456-458 | rpfm_ui/src/global_search_ui/mod.rs:933-935 | rpfm_ui/src/global_search_ui/mod.rs:944-946 | rpfm_ui/src/global_search_ui/mod.rs:955-957 | rpfm_ui/src/references_ui/mod.rs:240-250 | rpfm_ui/src/views/table/mod.rs:3831-3841 | rpfm_ui/src/views/table/mod.rs:3953-3955 | rpfm_ui/src/views/table/mod.rs:3970-3972 | rpfm_ui/src/views/table/mod.rs:3989-3990 | rpfm_ui/src/views/table/mod.rs:4075-4085 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/references_ui/mod.rs:250` calls `is_valid` and `rpfm_ui/src/app_ui/slots.rs:438` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–11 lines × 3) · ×1
  • Duplicated block (4–11 lines × 3) rpfm_ui/src/tools/faction_painter/mod.rs:953 — rpfm_ui/src/tools/faction_painter/mod.rs:953-956 | rpfm_ui/src/tools/faction_painter/mod.rs:1021-1031 | rpfm_ui/src/tools/faction_painter/mod.rs:1086-1096 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/tools/faction_painter/mod.rs:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/tools/faction_painter/mod.rs:1021` calls `par_iter` and `rpfm_ui/src/tools/faction_painter/mod.rs:953` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) rpfm_ui/src/views/table/columns_popover/mod.rs:225 — rpfm_ui/src/views/table/columns_popover/mod.rs:225-235 | rpfm_ui/src/views/table/columns_popover/mod.rs:257-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 13) · ×1
  • Duplicated block (9–10 lines × 13) rpfm_ui/src/app_ui/mod.rs:2212 — rpfm_ui/src/app_ui/mod.rs:2212-2220 | rpfm_ui/src/app_ui/mod.rs:2236-2245 | rpfm_ui/src/app_ui/mod.rs:2262-2270 | rpfm_ui/src/app_ui/mod.rs:2286-2295 | rpfm_ui/src/app_ui/mod.rs:2386-2395 | rpfm_ui/src/app_ui/mod.rs:2417-2426 | rpfm_ui/src/app_ui/mod.rs:2468-2477 | rpfm_ui/src/app_ui/mod.rs:2493-2502 | rpfm_ui/src/app_ui/mod.rs:2517-2526 | rpfm_ui/src/app_ui/mod.rs:2543-2552 | rpfm_ui/src/app_ui/mod.rs:2602-2610 | rpfm_ui/src/app_ui/mod.rs:2624-2633 | rpfm_ui/src/app_ui/mod.rs:2650-2659 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:2212` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–10 lines × 4) · ×1
  • Duplicated block (6–10 lines × 4) rpfm_lib/src/files/dat/mod.rs:173 — rpfm_lib/src/files/dat/mod.rs:173-182 | rpfm_lib/src/files/dat/mod.rs:186-195 | rpfm_lib/src/files/dat/mod.rs:199-208 | rpfm_lib/src/files/dat/mod.rs:209-214 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/dat/mod.rs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/dat/mod.rs:186` calls `read_u32` and `rpfm_lib/src/files/dat/mod.rs:209` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) rpfm_ui/src/app_ui/slots.rs:314 — rpfm_ui/src/app_ui/slots.rs:314-322 | rpfm_ui/src/views/table/mod.rs:3248-3257 | rpfm_ui/src/views/table/utils.rs:515-523 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) rpfm_lib/src/files/mod.rs:2231 — rpfm_lib/src/files/mod.rs:2231-2270 | rpfm_lib/src/files/mod.rs:2294-2333 — both copies are in the same file, so extract the 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 `rpfm_lib/src/files/mod.rs:2231` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) rpfm_ui/src/app_ui/mod.rs:2861 — rpfm_ui/src/app_ui/mod.rs:2861-2867 | rpfm_ui/src/app_ui/mod.rs:2871-2880 — both copies are in the same file, so extract the 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 `rpfm_ui/src/app_ui/mod.rs:2861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) rpfm_ui/src/utils/mod.rs:189 — rpfm_ui/src/utils/mod.rs:189-196 | rpfm_ui/src/welcome_page_ui/mod.rs:152-161 — 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 21) · ×1
  • Duplicated block (7–9 lines × 21) rpfm_ui/src/app_ui/mod.rs:2208 — rpfm_ui/src/app_ui/mod.rs:2208-2214 | rpfm_ui/src/app_ui/mod.rs:2232-2238 | rpfm_ui/src/app_ui/mod.rs:2258-2264 | rpfm_ui/src/app_ui/mod.rs:2282-2288 | rpfm_ui/src/app_ui/mod.rs:2306-2314 | rpfm_ui/src/app_ui/mod.rs:2331-2339 | rpfm_ui/src/app_ui/mod.rs:2357-2363 | rpfm_ui/src/app_ui/mod.rs:2381-2388 | rpfm_ui/src/app_ui/mod.rs:2413-2419 | rpfm_ui/src/app_ui/mod.rs:2438-2446 | rpfm_ui/src/app_ui/mod.rs:2464-2470 | rpfm_ui/src/app_ui/mod.rs:2489-2495 | rpfm_ui/src/app_ui/mod.rs:2513-2519 | rpfm_ui/src/app_ui/mod.rs:2538-2545 | rpfm_ui/src/app_ui/mod.rs:2563-2571 | rpfm_ui/src/app_ui/mod.rs:2598-2604 | rpfm_ui/src/app_ui/mod.rs:2620-2626 | rpfm_ui/src/app_ui/mod.rs:2646-2652 | rpfm_ui/src/app_ui/mod.rs:2670-2677 | rpfm_ui/src/app_ui/mod.rs:2687-2694 | rpfm_ui/src/app_ui/mod.rs:2705-2712 — all 21 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:2306` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 8) · ×1
  • Duplicated block (8–9 lines × 8) rpfm_ui/src/diagnostics_ui/mod.rs:801 — rpfm_ui/src/diagnostics_ui/mod.rs:801-809 | rpfm_ui/src/diagnostics_ui/mod.rs:851-858 | rpfm_ui/src/diagnostics_ui/mod.rs:911-919 | rpfm_ui/src/diagnostics_ui/mod.rs:970-977 | rpfm_ui/src/diagnostics_ui/mod.rs:1022-1029 | rpfm_ui/src/diagnostics_ui/mod.rs:1075-1082 | rpfm_ui/src/diagnostics_ui/mod.rs:1124-1132 | rpfm_ui/src/diagnostics_ui/mod.rs:1170-1178 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:801` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–9 lines × 8) · ×1
  • Duplicated block (3–9 lines × 8) rpfm_ui/src/global_search_ui/mod.rs:1311 — rpfm_ui/src/global_search_ui/mod.rs:1311-1319 | rpfm_ui/src/global_search_ui/mod.rs:1395-1403 | rpfm_ui/src/global_search_ui/mod.rs:1530-1538 | rpfm_ui/src/global_search_ui/mod.rs:1669-1677 | rpfm_ui/src/global_search_ui/mod.rs:1755-1763 | rpfm_ui/src/global_search_ui/mod.rs:1838-1846 | rpfm_ui/src/global_search_ui/mod.rs:1958-1966 | rpfm_ui/src/global_search_ui/mod.rs:2035-2037 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/global_search_ui/mod.rs:1311` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/global_search_ui/mod.rs:1309` calls `append_q_standard_item`, `new_item`, `into_ptr` and `rpfm_ui/src/global_search_ui/mod.rs:1394` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) rpfm_lib/src/games/supported_games.rs:834 — rpfm_lib/src/games/supported_games.rs:834-842 | rpfm_lib/src/games/supported_games.rs:1338-1346 | rpfm_lib/src/games/supported_games.rs:1858-1866 | rpfm_lib/src/games/supported_games.rs:2135-2143 | rpfm_lib/src/games/supported_games.rs:2353-2361 | rpfm_lib/src/games/supported_games.rs:2561-2569 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:834` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) rpfm_ui/src/app_ui/mod.rs:3331 — rpfm_ui/src/app_ui/mod.rs:3331-3337 | rpfm_ui/src/app_ui/mod.rs:3373-3381 | rpfm_ui/src/views/table/mod.rs:2788-2794 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:3331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–9 lines × 3) · ×1
  • Duplicated block (3–9 lines × 3) rpfm_ui/src/views/table/mod.rs:3821 — rpfm_ui/src/views/table/mod.rs:3821-3829 | rpfm_ui/src/views/table/mod.rs:3987-3989 | rpfm_ui/src/views/table/mod.rs:4065-4073 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/mod.rs:3821` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/views/table/mod.rs:3829` calls `is_valid` and `rpfm_ui/src/views/table/mod.rs:3989` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–9 lines × 3) · ×1
  • Duplicated block (2–9 lines × 3) rpfm_ui/src/views/table/mod.rs:3844 — rpfm_ui/src/views/table/mod.rs:3844-3852 | rpfm_ui/src/views/table/mod.rs:3942-3943 | rpfm_ui/src/views/table/mod.rs:4088-4096 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/mod.rs:3844` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/views/table/mod.rs:3852` calls `Some`, `get_packed_file_path` and `rpfm_ui/src/views/table/mod.rs:3943` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) rpfm_lib/src/games/supported_games.rs:412 — rpfm_lib/src/games/supported_games.rs:412-420 | rpfm_lib/src/games/supported_games.rs:611-619 | rpfm_lib/src/games/supported_games.rs:835-843 | rpfm_lib/src/games/supported_games.rs:1038-1046 | rpfm_lib/src/games/supported_games.rs:1339-1347 | rpfm_lib/src/games/supported_games.rs:1859-1867 | rpfm_lib/src/games/supported_games.rs:2136-2144 | rpfm_lib/src/games/supported_games.rs:2354-2362 | rpfm_lib/src/games/supported_games.rs:2562-2570 | rpfm_lib/src/games/supported_games.rs:2765-2773 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 7) · ×1
  • Duplicated block (7–8 lines × 7) rpfm_lib/src/games/supported_games.rs:1061 — rpfm_lib/src/games/supported_games.rs:1061-1068 | rpfm_lib/src/games/supported_games.rs:1361-1367 | rpfm_lib/src/games/supported_games.rs:1881-1887 | rpfm_lib/src/games/supported_games.rs:2158-2164 | rpfm_lib/src/games/supported_games.rs:2376-2382 | rpfm_lib/src/games/supported_games.rs:2584-2590 | rpfm_lib/src/games/supported_games.rs:2787-2793 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:1061` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (2–8 lines × 6) · ×1
  • Duplicated block (2–8 lines × 6) rpfm_ui/src/dependencies_ui/mod.rs:121 — rpfm_ui/src/dependencies_ui/mod.rs:121-129 | rpfm_ui/src/packedfile_views/animpack/mod.rs:119-120 | rpfm_ui/src/packedfile_views/animpack/mod.rs:124-125 | rpfm_ui/src/packedfile_views/esf/mod.rs:116-117 | rpfm_ui/src/packedfile_views/packfile/mod.rs:114-115 | rpfm_ui/src/packfile_contents_ui/mod.rs:211-218 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packfile_contents_ui/mod.rs:223` calls `new_packed_file_treeview_safe`, `static_upcast` and `rpfm_ui/src/dependencies_ui/mod.rs:134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 16) · ×1
  • Duplicated block (7 lines × 16) rpfm_ui/src/app_ui/mod.rs:2201 — rpfm_ui/src/app_ui/mod.rs:2201-2207 | rpfm_ui/src/app_ui/mod.rs:2225-2231 | rpfm_ui/src/app_ui/mod.rs:2251-2257 | rpfm_ui/src/app_ui/mod.rs:2275-2281 | rpfm_ui/src/app_ui/mod.rs:2299-2305 | rpfm_ui/src/app_ui/mod.rs:2324-2330 | rpfm_ui/src/app_ui/mod.rs:2350-2356 | rpfm_ui/src/app_ui/mod.rs:2374-2380 | rpfm_ui/src/app_ui/mod.rs:2431-2437 | rpfm_ui/src/app_ui/mod.rs:2457-2463 | rpfm_ui/src/app_ui/mod.rs:2482-2488 | rpfm_ui/src/app_ui/mod.rs:2506-2512 | rpfm_ui/src/app_ui/mod.rs:2531-2537 | rpfm_ui/src/app_ui/mod.rs:2591-2597 | rpfm_ui/src/app_ui/mod.rs:2613-2619 | rpfm_ui/src/app_ui/mod.rs:2639-2645 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:2201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×1
  • Duplicated block (7 lines × 10) rpfm_ui/src/diagnostics_ui/mod.rs:766 — rpfm_ui/src/diagnostics_ui/mod.rs:766-773 | rpfm_ui/src/diagnostics_ui/mod.rs:815-822 | rpfm_ui/src/diagnostics_ui/mod.rs:864-871 | rpfm_ui/src/diagnostics_ui/mod.rs:924-931 | rpfm_ui/src/diagnostics_ui/mod.rs:984-991 | rpfm_ui/src/diagnostics_ui/mod.rs:1036-1043 | rpfm_ui/src/diagnostics_ui/mod.rs:1089-1096 | rpfm_ui/src/diagnostics_ui/mod.rs:1138-1145 | rpfm_ui/src/global_search_ui/mod.rs:1373-1379 | rpfm_ui/src/global_search_ui/mod.rs:1732-1739 — there are 10 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 10 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) rpfm_extensions/src/gltf/mod.rs:177 — rpfm_extensions/src/gltf/mod.rs:177-184 | rpfm_extensions/src/gltf/mod.rs:195-201 | rpfm_extensions/src/gltf/mod.rs:212-218 | rpfm_extensions/src/gltf/mod.rs:229-235 | rpfm_extensions/src/gltf/mod.rs:246-252 | rpfm_extensions/src/gltf/mod.rs:263-269 | rpfm_extensions/src/gltf/mod.rs:280-304 | rpfm_extensions/src/gltf/mod.rs:315-321 | rpfm_extensions/src/gltf/mod.rs:332-338 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/gltf/mod.rs:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) rpfm_ui/src/packedfile_views/mod.rs:567 — rpfm_ui/src/packedfile_views/mod.rs:567-573 | rpfm_ui/src/packedfile_views/mod.rs:577-583 | rpfm_ui/src/packedfile_views/mod.rs:599-606 | rpfm_ui/src/packedfile_views/mod.rs:624-630 | rpfm_ui/src/packedfile_views/mod.rs:675-681 | rpfm_ui/src/packedfile_views/mod.rs:706-712 | rpfm_ui/src/packedfile_views/mod.rs:716-722 | rpfm_ui/src/packedfile_views/mod.rs:726-732 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/mod.rs:567` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) rpfm_server/src/ceo_builder.rs:429 — rpfm_server/src/ceo_builder.rs:429-435 | rpfm_server/src/ceo_builder.rs:510-516 | rpfm_server/src/ceo_builder.rs:593-599 | rpfm_server/src/ceo_builder.rs:686-692 | rpfm_server/src/ceo_builder.rs:769-775 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–7 lines × 5) · ×1
  • Duplicated block (6–7 lines × 5) rpfm_ui/src/views/table/utils.rs:268 — rpfm_ui/src/views/table/utils.rs:268-274 | rpfm_ui/src/views/table/utils.rs:283-289 | rpfm_ui/src/views/table/utils.rs:303-308 | rpfm_ui/src/views/table/utils.rs:318-323 | rpfm_ui/src/views/table/utils.rs:333-338 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/utils.rs:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 4) · ×1
  • Duplicated block (6–7 lines × 4) rpfm_ui/src/app_ui/slots.rs:459 — rpfm_ui/src/app_ui/slots.rs:459-464 | rpfm_ui/src/references_ui/mod.rs:252-258 | rpfm_ui/src/views/table/mod.rs:3843-3849 | rpfm_ui/src/views/table/mod.rs:4087-4093 — before extracting anything, compare `rpfm_ui/src/app_ui/slots.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/slots.rs:459` 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) rpfm_ui/src/tools/faction_painter/mod.rs:1009 — rpfm_ui/src/tools/faction_painter/mod.rs:1009-1038 | rpfm_ui/src/tools/faction_painter/mod.rs:1074-1103 — both copies are in the same file, so extract the 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 `rpfm_ui/src/tools/faction_painter/mod.rs:1009` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) rpfm_lib/src/games/supported_games.rs:380 — rpfm_lib/src/games/supported_games.rs:380-387 | rpfm_lib/src/games/supported_games.rs:577-584 | rpfm_lib/src/games/supported_games.rs:774-781 | rpfm_lib/src/games/supported_games.rs:1190-1197 | rpfm_lib/src/games/supported_games.rs:1474-1481 | rpfm_lib/src/games/supported_games.rs:3838-3845 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) rpfm_extensions/src/search/mod.rs:643 — rpfm_extensions/src/search/mod.rs:643-648 | rpfm_extensions/src/search/mod.rs:705-710 | rpfm_extensions/src/search/mod.rs:725-730 | rpfm_extensions/src/search/mod.rs:780-785 | rpfm_extensions/src/search/mod.rs:800-805 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/search/mod.rs:643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (2–6 lines × 5) · ×1
  • Duplicated block (2–6 lines × 5) rpfm_ui/src/app_ui/mod.rs:3570 — rpfm_ui/src/app_ui/mod.rs:3570-3575 | rpfm_ui/src/app_ui/mod.rs:3591-3592 | rpfm_ui/src/app_ui/mod.rs:3614-3619 | rpfm_ui/src/app_ui/mod.rs:3635-3636 | rpfm_ui/src/tools/ceo_builder/mod.rs:262-269 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/app_ui/mod.rs:3570` 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.
D4 · Code Duplication · Duplicated block (2–6 lines × 3) · ×1
  • Duplicated block (2–6 lines × 3) rpfm_extensions/src/dependencies/mod.rs:1022 — rpfm_extensions/src/dependencies/mod.rs:1022-1027 | rpfm_extensions/src/dependencies/mod.rs:1034-1039 | rpfm_extensions/src/dependencies/mod.rs:1046-1047 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/dependencies/mod.rs:1022` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_extensions/src/dependencies/mod.rs:1022` calls `dependencies`, `iter`, `for_each` and `rpfm_extensions/src/dependencies/mod.rs:1046` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–6 lines × 6) · ×1
  • Duplicated block (3–6 lines × 6) rpfm_ui/src/packedfile_views/anim_fragment_battle/mod.rs:98 — rpfm_ui/src/packedfile_views/anim_fragment_battle/mod.rs:98-100 | rpfm_ui/src/packedfile_views/audio/mod.rs:66-68 | rpfm_ui/src/packedfile_views/group_formations/mod.rs:260-262 | rpfm_ui/src/packedfile_views/packfile/mod.rs:106-110 | rpfm_ui/src/packedfile_views/portrait_settings/mod.rs:201-206 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:145-150 — `rpfm_ui/src/packedfile_views/portrait_settings/mod.rs` and `rpfm_ui/src/packedfile_views/unit_variant/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/packedfile_views/audio/mod.rs:72` calls `set_text`, `qtr` and `rpfm_ui/src/packedfile_views/anim_fragment_battle/mod.rs:104` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–6 lines × 3) · ×1
  • Duplicated block (3–6 lines × 3) rpfm_ui/src/tools/unit_editor/mod.rs:564 — rpfm_ui/src/tools/unit_editor/mod.rs:564-566 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:413-418 | rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs:706-711 — before extracting anything, compare `rpfm_ui/src/tools/unit_editor/mod.rs` and `rpfm_ui/src/tools/unit_editor/variant_unit_editor/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 261 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (1–6 lines × 4) · ×1
  • Duplicated block (1–6 lines × 4) rpfm_ui/src/references_ui/mod.rs:262 — rpfm_ui/src/references_ui/mod.rs:262-262 | rpfm_ui/src/views/table/mod.rs:3854-3859 | rpfm_ui/src/views/table/mod.rs:3943-3946 | rpfm_ui/src/views/table/mod.rs:4098-4103 — before extracting anything, compare `rpfm_ui/src/references_ui/mod.rs` and `rpfm_ui/src/views/table/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/mod.rs:3854` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_ui/src/views/table/mod.rs:3854` calls `set_is_preview` and `rpfm_ui/src/views/table/mod.rs:3943` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 22) · ×1
  • Duplicated block (8 lines × 22) rpfm_ui/src/app_ui/mod.rs:2204 — rpfm_ui/src/app_ui/mod.rs:2204-2211 | rpfm_ui/src/app_ui/mod.rs:2228-2235 | rpfm_ui/src/app_ui/mod.rs:2254-2261 | rpfm_ui/src/app_ui/mod.rs:2278-2285 | rpfm_ui/src/app_ui/mod.rs:2302-2309 | rpfm_ui/src/app_ui/mod.rs:2327-2334 | rpfm_ui/src/app_ui/mod.rs:2353-2360 | rpfm_ui/src/app_ui/mod.rs:2377-2384 | rpfm_ui/src/app_ui/mod.rs:2409-2416 | rpfm_ui/src/app_ui/mod.rs:2434-2441 | rpfm_ui/src/app_ui/mod.rs:2460-2467 | rpfm_ui/src/app_ui/mod.rs:2485-2492 | rpfm_ui/src/app_ui/mod.rs:2509-2516 | rpfm_ui/src/app_ui/mod.rs:2534-2541 | rpfm_ui/src/app_ui/mod.rs:2559-2566 | rpfm_ui/src/app_ui/mod.rs:2578-2585 | rpfm_ui/src/app_ui/mod.rs:2594-2601 | rpfm_ui/src/app_ui/mod.rs:2616-2623 | rpfm_ui/src/app_ui/mod.rs:2642-2649 | rpfm_ui/src/app_ui/mod.rs:2666-2673 | rpfm_ui/src/app_ui/mod.rs:2683-2690 | rpfm_ui/src/app_ui/mod.rs:2701-2708 — all 22 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 10) · ×1
  • Duplicated block (5 lines × 10) rpfm_lib/src/files/db/mod.rs:766 — rpfm_lib/src/files/db/mod.rs:766-770 | rpfm_lib/src/files/db/mod.rs:778-782 | rpfm_lib/src/files/db/mod.rs:790-794 | rpfm_lib/src/files/db/mod.rs:851-855 | rpfm_lib/src/files/db/mod.rs:1011-1015 | rpfm_lib/src/files/db/mod.rs:1076-1080 | rpfm_lib/src/files/db/mod.rs:1089-1093 | rpfm_lib/src/files/db/mod.rs:1099-1103 | rpfm_lib/src/files/db/mod.rs:1115-1119 | rpfm_lib/src/files/db/mod.rs:1349-1353 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:766` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rpfm_lib/src/files/db/mod.rs:1348` calls `extend`, `data`, `iter` and `rpfm_lib/src/files/db/mod.rs:1099` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) rpfm_ui/src/global_search_ui/mod.rs:1302 — rpfm_ui/src/global_search_ui/mod.rs:1302-1307 | rpfm_ui/src/global_search_ui/mod.rs:1386-1391 | rpfm_ui/src/global_search_ui/mod.rs:1521-1526 | rpfm_ui/src/global_search_ui/mod.rs:1660-1665 | rpfm_ui/src/global_search_ui/mod.rs:1746-1751 | rpfm_ui/src/global_search_ui/mod.rs:1829-1834 | rpfm_ui/src/global_search_ui/mod.rs:1949-1954 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rpfm_ui/src/global_search_ui/mod.rs:1309` calls `append_q_standard_item`, `new_item`, `into_ptr` and `rpfm_ui/src/global_search_ui/mod.rs:1393` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) rpfm_extensions/src/search/mod.rs:642 — rpfm_extensions/src/search/mod.rs:642-647 | rpfm_extensions/src/search/mod.rs:704-709 | rpfm_extensions/src/search/mod.rs:724-729 | rpfm_extensions/src/search/mod.rs:745-750 | rpfm_extensions/src/search/mod.rs:779-784 | rpfm_extensions/src/search/mod.rs:799-804 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_extensions/src/search/mod.rs:642` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:465 — rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:465-472 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:485-492 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:545-552 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:565-572 | rpfm_ui/src/packedfile_views/esf/esf_detailed_view/mod.rs:748-755 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) rpfm_ui/src/views/table/slots.rs:343 — rpfm_ui/src/views/table/slots.rs:343-348 | rpfm_ui/src/views/table/slots.rs:358-363 | rpfm_ui/src/views/table/slots.rs:395-399 | rpfm_ui/src/views/table/slots.rs:409-413 | rpfm_ui/src/views/table/slots.rs:533-538 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/views/table/slots.rs:343` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) rpfm_ui/src/diagnostics_ui/mod.rs:1307 — rpfm_ui/src/diagnostics_ui/mod.rs:1307-1311 | rpfm_ui/src/diagnostics_ui/mod.rs:1330-1334 | rpfm_ui/src/diagnostics_ui/mod.rs:1362-1366 | rpfm_ui/src/global_search_ui/mod.rs:1129-1133 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/diagnostics_ui/mod.rs:1307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) rpfm_lib/src/games/supported_games.rs:419 — rpfm_lib/src/games/supported_games.rs:419-438 | rpfm_lib/src/games/supported_games.rs:618-637 | rpfm_lib/src/games/supported_games.rs:842-861 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) rpfm_ui/src/packedfile_views/unit_variant/mod.rs:319 — rpfm_ui/src/packedfile_views/unit_variant/mod.rs:319-322 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:431-435 | rpfm_ui/src/packedfile_views/unit_variant/mod.rs:457-461 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) rpfm_lib/src/files/bmd/go_outlines/mod.rs:35 — rpfm_lib/src/files/bmd/go_outlines/mod.rs:35-55 | rpfm_lib/src/files/bmd/non_terrain_outlines/mod.rs:35-55 | rpfm_lib/src/files/bmd/terrain_outlines/mod.rs:36-56 | rpfm_lib/src/files/bmd/water_outlines/mod.rs:35-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/go_outlines/mod.rs:35` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) rpfm_extensions/src/search/anim_fragment_battle.rs:554 — rpfm_extensions/src/search/anim_fragment_battle.rs:554-561 | rpfm_extensions/src/search/atlas.rs:166-173 | rpfm_extensions/src/search/portrait_settings.rs:370-377 | rpfm_extensions/src/search/rigid_model.rs:396-403 | rpfm_extensions/src/search/table.rs:151-158 | rpfm_extensions/src/search/unit_variant.rs:190-197 | rpfm_extensions/src/search/unknown.rs:113-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) rpfm_lib/src/games/supported_games.rs:259 — rpfm_lib/src/games/supported_games.rs:259-267 | rpfm_lib/src/games/supported_games.rs:399-407 | rpfm_lib/src/games/supported_games.rs:596-605 | rpfm_lib/src/games/supported_games.rs:809-817 | rpfm_lib/src/games/supported_games.rs:2028-2036 | rpfm_lib/src/games/supported_games.rs:2298-2306 | rpfm_lib/src/games/supported_games.rs:2889-2897 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) rpfm_lib/src/games/supported_games.rs:261 — rpfm_lib/src/games/supported_games.rs:261-268 | rpfm_lib/src/games/supported_games.rs:401-408 | rpfm_lib/src/games/supported_games.rs:598-606 | rpfm_lib/src/games/supported_games.rs:811-818 | rpfm_lib/src/games/supported_games.rs:1027-1034 | rpfm_lib/src/games/supported_games.rs:2030-2037 | rpfm_lib/src/games/supported_games.rs:2300-2307 | rpfm_lib/src/games/supported_games.rs:2891-2898 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/games/supported_games.rs:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 37) · ×1
  • Duplicated block (9 lines × 37) rpfm_lib/src/files/bmd/ai_hints/directed_points/mod.rs:40 — rpfm_lib/src/files/bmd/ai_hints/directed_points/mod.rs:40-48 | rpfm_lib/src/files/bmd/ai_hints/mod.rs:52-60 | rpfm_lib/src/files/bmd/ai_hints/polylines/mod.rs:43-51 | rpfm_lib/src/files/bmd/ai_hints/polylines_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/ai_hints/separators/mod.rs:43-51 | rpfm_lib/src/files/bmd/ai_hints/separators/separator/mod.rs:41-49 | rpfm_lib/src/files/bmd/battlefield_building_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/battlefield_building_list_far/mod.rs:40-48 | rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs:43-51 | rpfm_lib/src/files/bmd/bmd_catchment_area_list/mod.rs:42-50 | rpfm_lib/src/files/bmd/bmd_outline_list/mod.rs:40-48 | rpfm_lib/src/files/bmd/building_projectile_emitter_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/camera_zones/mod.rs:40-48 | rpfm_lib/src/files/bmd/common/building_reference/mod.rs:82-90 | rpfm_lib/src/files/bmd/composite_scene_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/custom_material_mesh_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/deployment_region/boundary/mod.rs:41-49 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/deployment_region/mod.rs:46-54 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/deployment_zone/mod.rs:43-51 | rpfm_lib/src/files/bmd/deployment_list/deployment_area/mod.rs:44-52 | rpfm_lib/src/files/bmd/deployment_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/grass_list_reference_list/mod.rs:40-48 | rpfm_lib/src/files/bmd/light_probe_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/particle_emitter_list/mod.rs:70-78 | rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs:43-51 | rpfm_lib/src/files/bmd/point_light_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/prefab_instance_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/sound_shape_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/sound_shape_list/sound_shape/river_node/mod.rs:42-50 | rpfm_lib/src/files/bmd/spot_light_list/mod.rs:43-51 | rpfm_lib/src/files/bmd/terrain_decal_list/mod.rs:40-48 | rpfm_lib/src/files/bmd/terrain_stencil_blend_triangle_list/mod.rs:40-48 | rpfm_lib/src/files/bmd/terrain_stencil_triangle_list/mod.rs:43-51 | rpfm_lib/src/files/tile_database/conversion_params/mod.rs:78-86 | rpfm_lib/src/files/tile_database/tile_link/mod.rs:71-79 | rpfm_lib/src/files/tile_database/tile_link_target/mod.rs:56-64 | rpfm_lib/src/files/tile_database/tile_set/mod.rs:66-74 — before extracting anything, compare `rpfm_lib/src/files/bmd/bmd_catchment_area_list/bmd_catchment_area/valid_location_flags/mod.rs` and `rpfm_lib/src/files/bmd/playable_area/valid_location_flags/mod.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/bmd/ai_hints/directed_points/mod.rs:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) rpfm_ui/src/packedfile_views/decoder/slots.rs:235 — rpfm_ui/src/packedfile_views/decoder/slots.rs:235-243 | rpfm_ui/src/packedfile_views/decoder/slots.rs:269-277 | rpfm_ui/src/packedfile_views/decoder/slots.rs:310-318 | rpfm_ui/src/packedfile_views/decoder/slots.rs:344-352 | rpfm_ui/src/packedfile_views/decoder/slots.rs:385-393 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_ui/src/packedfile_views/decoder/slots.rs:235` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 14) · ×1
  • Duplicated block (6 lines × 14) rpfm_lib/src/files/db/mod.rs:741 — rpfm_lib/src/files/db/mod.rs:741-746 | rpfm_lib/src/files/db/mod.rs:753-758 | rpfm_lib/src/files/db/mod.rs:801-806 | rpfm_lib/src/files/db/mod.rs:813-818 | rpfm_lib/src/files/db/mod.rs:838-843 | rpfm_lib/src/files/db/mod.rs:862-867 | rpfm_lib/src/files/db/mod.rs:915-920 | rpfm_lib/src/files/db/mod.rs:927-932 | rpfm_lib/src/files/db/mod.rs:984-989 | rpfm_lib/src/files/db/mod.rs:1193-1198 | rpfm_lib/src/files/db/mod.rs:1217-1222 | rpfm_lib/src/files/db/mod.rs:1229-1234 | rpfm_lib/src/files/db/mod.rs:1241-1246 | rpfm_lib/src/files/db/mod.rs:1320-1325 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rpfm_lib/src/files/db/mod.rs:741` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
GD1 · Unfinished & placeholder code · Unfinished stub · ×1
  • Unfinished stub — body is todo!() / unimplemented!() rpfm_extensions/src/translator/mod.rs:572 — `apply` is a shipped function whose whole body is still `todo!()`/`unimplemented!()` — generated scaffolding that was never completed. Implement it or remove the dead surface.
IC1 · Incompleteness & stubs · Unfinished stub · ×1
  • Unfinished stub — body is todo!() / unimplemented!() rpfm_extensions/src/translator/mod.rs:572 — `apply` is a shipped function whose whole body is `todo!()`/`unimplemented!()` — scaffolding that was never completed, and a panic on the first call. Implement it or remove the dead surface.
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body — does nothing with its inputs rpfm_server/src/jobs.rs:229 — `notify` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
X18 · Disposal-pattern correctness · Raw handle taken from an owned value and never reclaimed · ×1
  • Raw handle taken from an owned value and never reclaimed rpfm_extensions/src/gltf/mod.rs:619 — `Box::<[T]>::into_raw(alloc)` (line 619) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and nothing in the crate's code ever reclaims a `Box` from a raw pointer (`Box::from_raw`). The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value.
Minor — 80 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×38
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1222 — `info!` at line 1222 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1257 — `info!` at line 1257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1288 — `info!` at line 1288 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1322 — `info!` at line 1322 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1632 — `info!` at line 1632 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1645 — `info!` at line 1645 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/ceo_builder.rs:1649 — `info!` at line 1649 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging REDACTED:197 — `info!` at line 197 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging REDACTED:201 — `warn!` at line 201 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging REDACTED:248 — `info!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:93 — `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:115 — `info!` at line 115 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:117 — `info!` at line 117 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:183 — `warn!` at line 183 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:207 — `info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:213 — `info!` at line 213 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:229 — `info!` at line 229 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/server_websocket.rs:237 — `info!` at line 237 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:213 — `info!` at line 213 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:215 — `info!` at line 215 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:219 — `error!` at line 219 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:307 — `info!` at line 307 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:310 — `info!` at line 310 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:382 — `info!` at line 382 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rpfm_server/src/session.rs:393 — `info!` at line 393 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 13 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×22
  • Duplicated predicate rpfm_ui/src/app_ui/mod.rs:2941 — `!complete_path.is_empty() && !complete_path.ends_with('/')` appears character-identically in 2 files — rpfm_ui/src/app_ui/mod.rs, rpfm_ui/src/packfile_contents_ui/slots.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/animpack/mod.rs:307 — `!disk_file_path.is_empty() && !is_encrypted && extra_data.lazy_load` appears character-identically in 2 files — rpfm_lib/src/files/animpack/mod.rs, rpfm_lib/src/files/pack/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_extensions/src/dependencies/mod.rs:612 — `!ref_table.is_empty() && !ref_column.is_empty()` appears character-identically in 2 files — rpfm_extensions/src/dependencies/mod.rs, rpfm_ui/src/packedfile_views/decoder/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/pack/pack_versions/pfh4.rs:41 — `(self.header.bitmask.contains(PFHFlags::HAS_EXTENDED_HEADER) && data_len < 44) || (!self.header.bitmask.contains(PFHFlags::HAS_EXTENDED_HEAD…` appears character-identically in 2 files — rpfm_lib/src/files/pack/pack_versions/pfh4.rs, rpfm_lib/src/files/pack/pack_versions/pfh5.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_extensions/src/startpos/world/agents.rs:117 — `campaign.is_empty() || campaign == *index.campaign()` appears character-identically in 2 files — rpfm_extensions/src/startpos/world/agents.rs, rpfm_extensions/src/startpos/world/legacy.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/pack/pack_versions/pfh5.rs:164 — `compress && file.is_compressible(game_info)` appears character-identically in 2 files — rpfm_lib/src/files/pack/pack_versions/pfh5.rs, rpfm_lib/src/files/pack/pack_versions/pfh6.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/esf/caab.rs:137 — `curr_pos != data_len && !Self::only_padding_remains(data)` appears character-identically in 2 files — rpfm_lib/src/files/esf/caab.rs, rpfm_lib/src/files/esf/cbab.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ui/src/views/table/mod.rs:3214 — `field_ref.is_key(patches) && field_ref.is_reference(patches).is_none()` appears character-identically in 2 files — rpfm_ui/src/views/table/mod.rs, rpfm_ui/src/views/table/slots.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ipc/src/settings.rs:195 — `game_key != KEY_EMPIRE && game_key != KEY_NAPOLEON && game_key != KEY_ARENA` appears character-identically in 2 files — rpfm_ipc/src/settings.rs, rpfm_ui/src/settings_ui/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_extensions/src/dependencies/mod.rs:456 — `index < path.len() - 1 && !folder.is_empty()` appears character-identically in 2 files — rpfm_extensions/src/dependencies/mod.rs, rpfm_lib/src/files/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ui/src/views/table/mod.rs:3181 — `item_old.text().compare_q_string(item.text().as_ref()) != 0 || item_old.check_state() != item.check_state()` appears character-identically in 2 files — rpfm_ui/src/views/table/mod.rs, rpfm_ui/src/views/table/slots.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/mod.rs:2664 — `path.ends_with(anim_fragment_battle::EXTENSION_OLD) || (path.starts_with(anim_fragment_battle::BASE_PATH) && path.contains(anim_fragment_bat…` appears character-identically in 2 files — rpfm_lib/src/files/mod.rs, rpfm_ui_common/src/icons/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/mod.rs:2660 — `path.starts_with(anims_table::BASE_PATH) && path.ends_with(anims_table::EXTENSION)` appears character-identically in 2 files — rpfm_lib/src/files/mod.rs, rpfm_ui_common/src/icons/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/integrations/assembly_kit/table_definition.rs:743 — `raw_field.fragment_path.is_some() && raw_field.filename_relative_path.is_none()` appears character-identically in 2 files — rpfm_lib/src/integrations/assembly_kit/table_definition.rs, rpfm_lib/src/schema/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/schema/mod.rs:1021 — `ref_table.trim().is_empty() || ref_column.trim().is_empty()` appears character-identically in 2 files — rpfm_lib/src/schema/mod.rs, rpfm_lib/src/schema/v4.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ui/src/app_ui/mod.rs:4339 — `root_type != rpfm_ui_common::ROOT_NODE_TYPE_EDITABLE_PACKFILE && root_type != rpfm_ui_common::ROOT_NODE_TYPE_MYMOD_PACKFILE` appears character-identically in 2 files — rpfm_ui/src/app_ui/mod.rs, rpfm_ui/src/command_palette_ui/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_extensions/src/startpos/world/bodyguards.rs:94 — `row_faction.is_empty() && row_subculture == *faction.subculture()` appears character-identically in 3 files — rpfm_extensions/src/startpos/world/bodyguards.rs, rpfm_extensions/src/startpos/world/government.rs, rpfm_extensions/src/startpos/world/legacy.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_extensions/src/startpos/world/bodyguards.rs:95 — `row_faction.is_empty() && row_subculture.is_empty() && row.str("culture_key")` appears character-identically in 2 files — rpfm_extensions/src/startpos/world/bodyguards.rs, rpfm_extensions/src/startpos/world/government.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_lib/src/files/pack/pack_versions/pfh3.rs:111 — `self.compress && compression_format != CompressionFormat::None && self.supports_compression_format(compression_format)` appears character-identically in 3 files — rpfm_lib/src/files/pack/pack_versions/pfh3.rs, rpfm_lib/src/files/pack/pack_versions/pfh5.rs, rpfm_lib/src/files/pack/pack_versions/pfh6.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ui/src/app_ui/slots.rs:303 — `settings_bool(ENABLE_ICONS) && field.is_filename(patches)` appears character-identically in 3 files — rpfm_ui/src/app_ui/slots.rs, rpfm_ui/src/views/table/mod.rs, rpfm_ui/src/views/table/slots.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_server/src/state/diagnostics.rs:126 — `total >= request.offset && page.len() < limit` appears character-identically in 2 files — rpfm_server/src/state/diagnostics.rs, rpfm_server/src/state/search.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rpfm_ui/src/app_ui/mod.rs:4097 — `variant.is_valid() && !variant.is_null()` appears character-identically in 3 files — rpfm_ui/src/app_ui/mod.rs, rpfm_ui/src/global_search_ui/mod.rs, rpfm_ui/src/pack_tree/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Silent fallback default on Err · ×4
  • Silent fallback default on Err rpfm_extensions/src/startpos/world/mod.rs:464 — `husband_factions` turns every `Err` into `Ok(HashMap::new())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rpfm_extensions/src/startpos/world/mod.rs:489 — `widowed` turns every `Err` into `Ok(HashSet::new())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rpfm_server/src/state/tables.rs:1163 — `references_in_file` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rpfm_ui/src/packedfile_views/decoder/mod.rs:1001 — `decode_data_by_fieldtype` turns every `Err` into `"Error".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×3
  • Projects may be oversized for their cohesion rpfm_lib/Cargo.toml:1 — `rpfm_lib` (64043 LoC, 431 module-visible types across 158 directories) overshoots its size bounds. 3 of 8 build unit(s) (Cargo) overshoot their size bounds, lowering Project Cohesion to 2.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion rpfm_ui/Cargo.toml:1 — `rpfm_ui` (50224 LoC, 181 module-visible types across 58 directories) overshoots its size bounds. 3 of 8 build unit(s) (Cargo) overshoot their size bounds, lowering Project Cohesion to 2.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion rpfm_extensions/Cargo.toml:1 — `rpfm_extensions` (31395 LoC, 264 module-visible types across 15 directories) overshoots its size bounds. 3 of 8 build unit(s) (Cargo) overshoot their size bounds, lowering Project Cohesion to 2.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found REDACTED:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 1).
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:6 — No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation Cargo.toml:56 — `Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).
S1 · Web-Security Posture · No inbound request validation detected · ×1
  • No inbound request validation detected — No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (REDACTED:198).
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand rpfm_ui/src/tools/unit_editor/mod.rs:999 — `key.starts_with("unit_variants_colours")` can never decide this `||` — every value satisfying `key.starts_with("unit_variants_colours")` also satisfies `key.starts_with("unit_variants")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 29 finding(s)
D12 · Dependency Hygiene · Outdated · ×29
  • Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"^1"` requirement declared in rpfm_server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: backtrace — `backtrace` is locked at 0.3.76 but 0.3.77 is the current stable release on crates.io, and it already satisfies the `"^0.3"` requirement declared in rpfm_telemetry/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
  • Outdated: bitflags — `bitflags` is locked at 2.13.0 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"^2.3"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` and commit the updated REDACTED.
  • Outdated: crossbeam — `crossbeam` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"^0.8"` requirement declared in rpfm_ui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam` and commit the updated REDACTED.
  • Outdated: deepl — `deepl` is locked at 0.8.0 but 0.8.2 is the current stable release on crates.io, and it already satisfies the `"^0"` requirement declared in rpfm_ui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p deepl` and commit the updated REDACTED.
  • Outdated: encoding_rs — `encoding_rs` is locked at 0.8.35 but 0.8.44 is the current stable release on crates.io, and it already satisfies the `"^0.8"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
  • Outdated: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"^0.3"` requirement declared in rpfm_server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.32 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"^0.4"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: lz4_flex — `lz4_flex` is locked at 0.13.1 but 0.14.2 is the current stable release on crates.io, and it already satisfies the `"^0"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. This crosses a compatibility boundary. Run `cargo update -p lz4_flex` and commit the updated REDACTED.
  • Outdated: memchr — `memchr` is locked at 2.8.2 but 2.8.3 is the current stable release on crates.io, and it already satisfies the `"^2.5"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memchr` and commit the updated REDACTED.
  • Outdated: mlua — `mlua` is locked at 0.12.1 but 0.12.2 is the current stable release on crates.io, and it already satisfies the `"^0.12"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mlua` and commit the updated REDACTED.
  • Outdated: open — `open` is locked at 5.3.5 but 5.4.5 is the current stable release on crates.io, and it already satisfies the `"^5"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p open` and commit the updated REDACTED.
  • Outdated: rand — `rand` is locked at 0.10.1 but 0.10.4 is the current stable release on crates.io, and it already satisfies the `"^0.10"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rand` and commit the updated REDACTED.
  • Outdated: regex — `regex` is locked at 1.12.4 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"^1"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
  • Outdated: reqwest — `reqwest` is locked at 0.13.4 but 0.13.5 is the current stable release on crates.io, and it already satisfies the `"^0.13"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p reqwest` and commit the updated REDACTED.
  • Outdated: rmcp — `rmcp` is locked at 3.1.0 but 3.11.0 is the current stable release on crates.io, and it already satisfies the `"^3"` requirement declared in rpfm_server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rmcp` and commit the updated REDACTED.
  • Outdated: rodio — `rodio` is locked at 0.22.2 but 0.23.0 is the current stable release on crates.io, and it already satisfies the `"^0"` requirement declared in rpfm_ui/Cargo.toml — so the lockfile is behind this repository's own declared range. This crosses a compatibility boundary. Run `cargo update -p rodio` and commit the updated REDACTED.
  • Outdated: schemars — `schemars` is locked at 1.2.1 but 1.2.3 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in rpfm_ipc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p schemars` and commit the updated REDACTED.
  • Outdated: sentry — `sentry` is locked at 0.48.2 but 0.49.6 is the current stable release on crates.io, and it already satisfies the `"^0"` requirement declared in rpfm_telemetry/Cargo.toml — so the lockfile is behind this repository's own declared range. This crosses a compatibility boundary. Run `cargo update -p sentry` and commit the updated REDACTED.
  • Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"^1.0"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
  • Outdated: serde_derive — `serde_derive` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"^1.0"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_derive` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.150 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"^1.0"` requirement declared in rpfm_extensions/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: steamlocate — `steamlocate` is locked at 2.1.0 but 2.1.1 is the current stable release on crates.io, and it already satisfies the `"2.0.0-beta.0"` requirement declared in rpfm_lib/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p steamlocate` and commit the updated REDACTED.
  • Outdated: thiserror — `thiserror` is locked at 2.0.18 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"^2"` requirement declared in rpfm_ipc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
  • Outdated: time — `time` is locked at 0.3.49 but 0.3.55 is the current stable release on crates.io, and it already satisfies the `"^0.3"` requirement declared in rpfm_server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p time` and commit the updated REDACTED.
  • + 4 more in this group — see findings.md.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-38e3967129e44edd8aff0d6e1083d771/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-38e3967129e44edd8aff0d6e1083d771/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-38e3967129e44edd8aff0d6e1083d771/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=803" --report-format json --report-path /tmp/watchdog-gitleaks-38e3967129e44edd8aff0d6e1083d771/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-38e3967129e44edd8aff0d6e1083d771/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude docs/server/methods .24artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .42artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1eaea-c420-7088-9e31-fdc431f5f91b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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