Public report — WeiXinMPSDK, published 23 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.15 (frozen) · verify this surveyFiledcd_4c2a00644ae44e8dbc98efd5f1c52c99
Filed 25 September 2026, 05:08 UTC
Public
Large · 172,552 LoC · 94 projects · rebuild ~1.9 person-years · weakest lens: Code Health (38%)
Findings by grade
134 critical1355 serious132 minor4 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
23 September 2026, 04:07 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
1554findings with an exact file:lineof 1621 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
93/127dimensions across the health lenses172552 LoC · 94 projects — wide & deep
The system holds significant value but carries a weak overall standing of 44%, indicating a workable asset with substantial hidden risks. With a rebuild cost nearing €270,000 and nearly two years of engineering effort, the business has a large investment at stake. The primary concern is not immediate failure, but the accumulating cost of maintaining a codebase that is becoming increasingly difficult and expensive to modify safely.
The most critical risk is fragile code health. Despite a robust architecture that prevents changes from rippling uncontrollably, the code itself is difficult to maintain. Nearly half of the production code is boilerplate rather than core logic, and the low health score suggests that every new feature will require disproportionate effort to implement and test. This directly threatens delivery speed and inflates long-term operational costs, as engineers spend more time navigating complexity than building value.
Operational readiness and security exposure present a secondary layer of concern. The system lacks sufficient testing and observability, making it hard to detect issues before they reach users. While no confirmed security breaches were found, the low security score indicates gaps in best practices that could leave the business vulnerable to future threats. Additionally, key areas like domain modeling and event handling were not measured, meaning the full extent of these risks remains unknown.
On the positive side, the architecture is strong, and the team has made progress in some areas. However, the path forward is clear. The highest-leverage action is to migrate the remaining JavaScript files to TypeScript. This single step will immediately improve code safety, reduce bugs, and lay the groundwork for better maintainability. Focusing here first offers the best return on investment, protecting the significant value tied up in this large asset while setting the stage for deeper remediation.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
0.7× (at 44% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified for 34,258 line(s) outside the .NET model (the tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~1.9 person-years of build effort (about ~€270,000 to rebuild). Its weakest lens is Code Health at 38% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.2) — service/app, CQRS × a 0.7× quality factor, at €60–95/h; indicative, ±~30%. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 1 BlanketAnalyzerSeverityNone finding(s) in Explicit Debt — start with quality.globalconfig.
Value concentrated against a weak lens · REDACTED · Value at risk
This is a Large asset (~1.9 person-years to rebuild), and its weakest lens is Code Health at 38%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · REDACTED · Leverage
Of everything flagged, the best return on effort is: Migrate the remaining .js/.jsx files to TypeScript. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Migrate the remaining .js/.jsx files to TypeScript.
Architecture — bounded-context dependency graph
Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
320 modules, 513 dependencies. 7 dependency cycles across 16 modules, marked above the diagonal.
Showing the 40 most-connected modules; 280 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
MP.AdvancedAPIs.NewTmpl uses MP.AdvancedAPIs.TemplateMessage. Changing MP.AdvancedAPIs.TemplateMessage can break MP.AdvancedAPIs.NewTmpl, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
Work.AdvancedAPIs uses Work. Changing Work can break Work.AdvancedAPIs, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→31 Work.AdvancedAPIs depends on Work.AdvancedAPIs.External.ExternalJson✕
Type pairs
29 distinct (type in Work.AdvancedAPIs → type in Work.AdvancedAPIs.External.ExternalJson) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Work.AdvancedAPIs uses Work.AdvancedAPIs.External.ExternalJson. Changing Work.AdvancedAPIs.External.ExternalJson can break Work.AdvancedAPIs, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A02:2021 — Cryptographic Failures
50
REDACTED / Critical
A03:2021 — Injection
42
REDACTED / Critical
A06:2021 — Vulnerable & Outdated Components
24
REDACTED / Critical
A04:2021 — Insecure Design
1
REDACTED
Roadmap
First, migrate the remaining JavaScript files to TypeScript to establish type safety and prevent future errors. Next, remove dead code and unused exports to reduce maintenance overhead and streamline builds. Then, ensure async operations respect cancellation tokens for responsive behavior and verify disposal patterns to correctly manage resource ownership. Finally, address swallowed exceptions to improve error visibility and system reliability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 BlanketAnalyzerSeverityNone finding(s) in Explicit Debt — start with quality.globalconfig.
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.
Each finding names the throw and the test in its own condition that is true of a NON-null value. Confirm from the two, then throw the exception that describes what was actually wrong: `ArgumentException` for a value that arrived empty, or the .NET 8 helpers that spell the whole guard in one line and pick the type for you — `ArgumentException.ThrowIfNullOrEmpty(s)` / `ThrowIfNullOrWhiteSpace(s)` for strings, `ArgumentNullException.ThrowIfNull(x)` followed by `ArgumentOutOfRangeException.ThrowIfZero(x.Count)` for a collection. Splitting the two conditions is usually clearer than picking one exception for both: they are different failures and the caller may want to handle them differently.
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 — 134
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 — 1355
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 — 132
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 4
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
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 87 of 93 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 6 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 93 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1554 of 1621 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,129 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 3 test source file(s) (.js) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
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 (158 contributor(s) across 11223 commit(s) sampled, automation and bot accounts excluded). One of them holds 86% of the history; the other 157 hold 0.1% 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.
D18 Solution Shape — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. A scan analyzes ONE solution. Every score, lens, and finding here reflects only `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10.sln`; 13 further solution(s) found in this tree (`Samples/All/console/Senparc.Weixin.MP.Sample.Consoles.NET10.sln`, `Samples/All/console/Senparc.Weixin.MP.Sample.Consoles.NET8.sln`, `Samples/All/net45-mvc/Senparc.Weixin.MP.Sample.Net45.sln`, `Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8.sln`, `Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.Net10.sln`, `Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.Net8.sln`, +7 more) are not covered by it, were not analyzed, and are not represented in the headline. (This is a count of the solutions discovery found and could not show to be covered by the analyzed one — not a claim about how many solution files the repository contains.) If one of them is an archived or vendored tree, declaring it — `.gitattributes` (`path/** linguist-vendored`) or `.editorconfig` (`[path/**] generated_code = true`) — excludes it from discovery the same way generated code is. You can widen what we reach: scan each solution separately.
D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
D23 Boundary Type-Coupling — not measured this run — Watchdog 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. At 278k LoC across 94 projects this is a very large multi-module system that clearly needs explicit bounded contexts. Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D30 Dependency Vulnerabilities — measured, with a gap in what it reached — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 2 of 3 declared ecosystem(s) (npm,osv) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. `Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/ChatStore.cs`, `Samples/All/Senparc.Weixin.Sample.CommonService/EventService.cs`, `REDACTED`, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs`, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/SubscribeMsgController.cs`, … (+61 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D39 IL Efficiency — not measured this run — Watchdog 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. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
D43 Malicious Dependencies — measured, with a gap in what it reached — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 2 of 3 declared ecosystem(s) (npm,osv) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
IC1 Incompleteness & stubs — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 509 further occurrence(s) are not listed individually; the score already reflects all 549.
X2 Cancellation propagation — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 1545 further occurrence(s) are not listed individually; the score already reflects all 1585.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
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.
C5 Data-Subject Rights: This control is scored from in-repo evidence only — absence of evidence here means the scan found no in-repo trace, not that the control does not exist.
ED5 Idempotency: Idempotency is judged from the handler body's visible writes and guards — a guard enforced by a database unique constraint, a broker's exactly-once delivery, or a domain method whose no-op-when-applied logic the scan can't follow may read as at-risk; the at-risk candidates are confirmed by a SAMPLED LLM verdict (advisory, not exhaustive) and degrade to heuristic-only when no model is configured. It flags the at-least-once double-apply SHAPE, not a runtime proof of a duplicate effect.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (6): D19, D21, D24, D26, ED5, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
21 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DefaultWorkMessageContext.GetRequestEntityMappingResult at 74. A further 14 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 DefaultMpMessageContext.GetRequestEntityMappingResult at 67 — they are counted neither in the figure above nor in this dimension's score. 9 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs (DefaultMpMessageContext.GetRequestEntityMappingResult at 67), src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs (MessageHandler.OnEventRequestAsync at 59), src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs (MessageHandler.OnEventRequest at 59), src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs (DefaultWxOpenMessageContext.GetRequestEntityMappingResult at 36), src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs (WxOpenMessageHandler.OnEventRequest at 34), and 4 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.
+ 16 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 DefaultWorkMessageContext.GetRequestEntityMappingResult (cyclomatic 74) finding(s) in Cyclomatic Complexity — start with DefaultWorkMessageContext.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 WorkMessageHandler.OnEventRequestAsync (cyclomatic 68) finding(s) in Cyclomatic Complexity — start with WorkMessageHandler.Async.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 EntityHelper.FillEntityWithXml (cyclomatic 48) finding(s) in Cyclomatic Complexity — start with EntityHelper.cs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 22 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 CommonApi.GetMenuFromJson (cognitive 17) finding(s) in Cognitive Complexity — start with CommonApi.Menu.cs, CommonApi.Menu.Custom.cs. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 EntityHelper.FillEntityWithXml (cognitive 67) finding(s) in Cognitive Complexity — start with EntityHelper.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 RedPackApi.SearchRedPack (cognitive 66) finding(s) in Cognitive Complexity — start with RedPackApi.cs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.0 / 10Stronggated by 67 serious findings✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 38 TooManyMethods finding(s) in God Classes — start with MeetingApi.Layout.cs, WorkMessageHandler.cs, ExternalApi.cs. — One of this dimension's main actionable groups (38 warning-level).
Resolve the 13 MethodTooLong finding(s) in God Classes — start with WxOpenMessageHandler.Event.cs (2), WorkMessageHandler.Async.cs, DefaultWorkMessageContext.cs. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 8 ClassTooLong finding(s) in God Classes — start with CardAPI.cs, ShakeAroundApi.cs, MassApi.cs. — One of this dimension's main actionable groups (8 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
469 duplicated block group(s) detected. A further 31 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 117 of the 500 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 204 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 Duplicated block (18 lines × 2) finding(s) in Code Duplication — start with MeetingManagementJson.cs, WorkResponseMessageBase.cs, ResponseMessageFactory.cs. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), NonTaxPayApi.cs (2), MassApi.cs. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 15 Members sharing a duplicated core (4 members, 50+ identical tokens) finding(s) in Code Duplication — start with TenPayApiV3Controller.cs (3), CommentApi.cs (2), NonTaxPayApi.cs. — One of this dimension's main actionable groups (15 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.7 / 10Stronggated by 3 serious findings✓ 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.
Off the main sequence: Senparc.Weixin.net10(net462) · ×2
Unstable project Senparc.Weixin.All.net10
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Unstable project Senparc.Weixin.All.net10 finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with TenPayHttpClient.cs, MsgAuditFinanceNativeApi.cs. — One of this dimension's main actionable groups (2 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
No test project references Senparc.Weixin.MP.srcsrc/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.src.csproj
No test project references Senparc.Weixin.WxOpen.Packagessrc/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.Packages.csproj
No test project references Senparc.Weixin.TenPaysrc/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.csproj
No test project references Senparc.WebSocket.packagessrc/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.packages.csproj
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 Low coverage finding(s) in Code Coverage — start with RandomNumberTools.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No test project references Senparc.Weixin.MP.src finding(s) in Code Coverage — start with Senparc.Weixin.MP.src.csproj. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No test project references Senparc.Weixin.WxOpen.Packages finding(s) in Code Coverage — start with Senparc.Weixin.WxOpen.Packages.csproj. — One of this dimension's main actionable groups (1 warning-level).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
1107 test methods: 1107 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.4 / 10Adequategated by 9 critical findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 35 zero-assertion, 3 synchronised by a fixed sleep, 12 whose failure is swallowed by a catch-all, 7 mock references across 1129 tests. Measured on the C# suite only — at least 3 test source file(s) (.js) went unread, so its test quality is unmeasured and is not in these counts.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 Assertions commented out finding(s) in Test Quality — start with MessageHandlersTest.cs (3), CacheStrategyFactoryTests.cs, BaseContainerTests.cs. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with OAuthTest.cs, AccessTokenContainerLockTest.cs, TenPayTest.cs. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 19 No assertions finding(s) in Test Quality — start with WxAppApiTests.cs (2), SerializeTest.cs (2), WeixinRegisterTests.cs (2). — One of this dimension's main actionable groups (19 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
0 outdated, 0 vulnerable, 0 deprecated packages. Those are the NuGet packages; this repository's npm dependencies were read too — 27 outdated of 44 package(s) across 2 lockfile(s).
Outdated (npm): asynckit · ×27
What to do
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 671 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 74 direct `PackageReference`(s), and 192 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 12 Hotspot finding(s) in Churn × Complexity Hotspots — start with WorkMessageHandler.Async.cs, DefaultWorkMessageContext.cs, DefaultWxOpenMessageContext.cs. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HomeController.cs (7), CaseCollectionController.cs, AsyncMethodsController.cs. — One of this dimension's main actionable groups (12 issue-level).
Resolve the 5 EmptyCatchBlock finding(s) in Explicit Debt — start with CustomMessageHandler.cs (2), WeixinTrace.cs (2), WebSocketHandler_Common.cs. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 1 BlanketAnalyzerSeverityNone finding(s) in Explicit Debt — start with quality.globalconfig. — One of this dimension's main actionable groups (1 issue-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
94 projects, 8522 source files, 318651 hand-written lines of code (278583 production / 40068 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), 188 inter-project edges.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
Senparc.Weixin SDK 的文档质量极高,包含 README、规范文件、分模块独立文档、AI+微信示例、源码说明、VSCode扩展工具和测试项目,内容完整且结构清晰。文档覆盖了项目概述、安装/使用指南、各平台SDK(公众号、小程序、企业微信)、支付V2/V3、AI集成、NuGet包引用、开发指南、本地构建、打包为vsix、以及独立的P2P开源项目页面。 The Senparc.Weixin project has strong documentation across READMEs and architecture/Docs markdown files. The README for the WeChat MCP server is a single line '# WeChat MCP Server' with no content; the WebSocket README is well-structured (installation, contribution, test commands) but clipped mid-table at '## 贡献代码'; the Quality/README.md covers incremental quality gates and an ApiCompat gate. The Chinese docs directory lists guide/mp/* sections for each platform, including wxopen/install, login, get-phone-number, and a complete guide/mp/ subdirectory; the outline is present in every named document. Coverage figures are low (XML-docs at 85-93% across Senparc.Weixin projects), but the visible content is clear.
Documentation: no installation or build instructions · ×3README.md
Resolve the 3 Documentation finding(s) in Documentation Quality — start with README.md (3). — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 naming inconsistencies across 200 sampled symbols.
Inconsistent casing and versioning in the TenPay namespace: 'TenPay' (PascalCase) vs 'Tenpay' (camelCase) and 'V2'/'V3' vs 'V3' embedded in names. Specifically, `TenpayV3ProfitShareingAddReceiverRequestData` uses lowercase 'p' in 'Tenpay' and misspells 'Sharing' as 'Shareing', while other types use 'TenPay' or 'TenPayV3'.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D24 · Comment ValueExemplary◐ Sampled · advisory
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.
6 of 35 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
90 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged REDACTED. 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.
49 finding(s): 0 critical, 49 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 49 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (9), REDACTED (8). — One of this dimension's main actionable groups (49 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
42 finding(s): 0 critical, 6 high, 36 medium, 0 low. 6 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 106 file(s) — `Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/ChatStore.cs` (lines 24–25, line 151), `Samples/All/Senparc.Weixin.Sample.CommonService/EventService.cs` (line 136, line 137, line 138, …), `REDACTED` (lines 12–28, line 69), `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs` (line 115, line 167), `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/SubscribeMsgController.cs` (line 88), … (+101 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. In 1 of those file(s) — `Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/ChatStore.cs` — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 8 of those file(s) — `src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Helpers/WebSocketHelper.cs`, `src/Senparc.Weixin.Open/Senparc.Weixin.Open.Test/WxaAPIs/Ams/AmsContractTests.cs`, `src/Senparc.Weixin.Open/Senparc.Weixin.Open.Test/WxaAPIs/CloudBaseBatch/CloudBaseBatchContractTests.cs`, `src/Senparc.Weixin.Open/Senparc.Weixin.Open.Test/WxaAPIs/CloudRun/CloudRunContractTests.cs`, `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/AdvancedAPIs/B2B/B2BContractTests.cs`, … (+3 more) — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything.
REDACTED
REDACTED
What to do
Resolve the 36 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (36 warning-level).
No action in Static Analysis (SAST) — all 6 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 (6 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir/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, Go, Java and Kotlin via Maven/Gradle, 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.
24 finding(s): 0 critical, 18 high, 5 medium, 1 low. Partial dependency scan: 2 of 3 declared ecosystem(s) were scanned (npm,osv), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 16 REDACTED CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (16). — One of this dimension's main actionable groups (16 issue-level).
Resolve the 5 REDACTED CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
Resolve the 2 REDACTED vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.
Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.
1 finding(s): 0 critical, 0 high, 1 medium, 0 low. semgrep could not parse 66 file(s) — `Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/ChatStore.cs`, `Samples/All/Senparc.Weixin.Sample.CommonService/EventService.cs`, `REDACTED`, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs`, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/SubscribeMsgController.cs`, … (+61 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
249 of 1098 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs. Counted over 1098 of the 1905 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 33 Orphaned knowledge finding(s) in Knowledge Freshness — start with ShakeAroundApi.cs, QueryBusifavorStockReturnJson.cs, InvoiceApi.cs. — One of this dimension's main actionable groups (33 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Change coupling finding(s) in Change Coupling — start with DefaultWorkMessageContext.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
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. Scored 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. SCORED, not informational.
No known-vulnerable dependencies in the 2 ecosystem(s) that were scanned (npm,osv). Partial dependency scan: 2 of 3 declared ecosystem(s) were scanned (npm,osv), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.
What it measures: Whether anyone still 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.
2 end-of-life runtime(s) and 0 end-of-life framework(s), read from 85 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 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.
End-of-life runtime: .NET net6.0 · ×2
What to do
Resolve the 2 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — tools/WeixinBrowserPlugin/src/demo-url-change-feature.html:2, tools/WeixinBrowserPlugin/src/popup.html:2, tools/WeixinBrowserPlugin/src/test.html:2
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — tools/WeixinBrowserPlugin/src/demo-url-change-feature.html:213
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 4 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. Deterministic, type-level.
`ISenparcWeixinSettingForTenpayV3` declares 18 members: `TenPayV3_MchId`, `TenPayV3_SubMchId`, `TenPayV3_Key`, `TenPayV3_CertPath`, `TenPayV3_CertSecret`, `TenPayV3_AppId`, `TenPayV3_AppSecret`, `TenPayV3_SubAppId`, `TenPayV3_SubAppSecret`, `TenPayV3_TenpayNotify`, `TenPayV3_PrivateKey`, `TenPayV3_SerialNumber`, `TenPayV3_APIv3Key`, `TenPayV3_TenPayPubKey`, `TenPayV3_TenPayPubKeyID`, `TenPayV3_TenPayPubKeyEnable`, `TenPayV3_WxOpenTenpayNotify`, `EncryptionType`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs:163
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Do you agree with this assessment?
C1 · Data Protection6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
What to do
Strengthen data-at-rest protection: vault your keys (Azure Key Vault / AWS KMS / IDataProtector key ring) and encrypt the most sensitive columns (EF HasConversion encryption or provider-native column encryption) — partial coverage still leaves gaps.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (via [Authorize]/guards) — this is NOT a claim that endpoints are unprotected. What's missing is NAMED policies (AddAuthorization/AddPolicy, RequireRole/RequireClaim, RequireAuthorization): the access rules are implicit rather than named and testable. Recommendation, not a defect — name the rules so they're reviewable.
What to do
Add policy-based authorization — name the access rules (AddAuthorization(o => o.AddPolicy(…))) and apply them via [Authorize(Policy = …)] or RequireAuthorization.
Other · Security — Whether GDPR data-subject requests are supported in code — erasure, export/portability, consent.
Method: Roslyn scan: GDPR data-subject-rights corroboration (erasure/export/consent vocabulary co-occurring with subject-id store crossing or explicit GDPR pattern). Deterministic, gated by PII.
Corroborated rights: erasure ✗ · export ✓ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.
What to do
Implement erasure ('right to be forgotten') over the data subject's records, tied to their subject/user id.
Track GDPR consent (lawful basis) alongside the personal data it authorises.
Do you agree with this assessment?
ED5 · Idempotency3.0 / 10Weak◐ Sampled · advisory
Other · Readiness — Whether retry-prone mutations (command handlers + message/event consumers) are idempotent so an at-least-once redelivery or client retry doesn't double-apply the effect — heuristic at-risk detection confirmed by language model, advisory.
Method: Roslyn heuristic (any mutation, ungated): command handlers and message/event consumers that mutate persistent state without a visible idempotency guard (exists/dedup check, upsert, idempotency-key/inbox, conditional/versioned write, fixed-value set) flagged as at-risk; each at-risk candidate then confirmed or cleared by a language model as genuinely non-idempotent versus naturally-idempotent. Advisory without a model (heuristic-only, degraded), per-candidate judged with one.
Coverage: Population: retry-prone mutations — command handlers (CQRS write side) + message/event consumers (IConsumer/I*EventHandler) — that mutate persistent state; runs on any repo with mutations, not only event-driven ones. The at-risk subset (no obvious guard) is a HEURISTIC candidate set, each then LLM-JUDGED non-idempotent vs safe; a handler outside those conventions, or a guard the LLM can't confirm, is bounded by the sample. Degrades to heuristic-only when no model is configured.
`WebSocket.CustomNetCoreWebSocketMessageHandler.OnMessageReceiced` mutates persistent state (a repository write one hop away, in SessionContainer.GetSession) with no visible idempotency guard. Under a client retry or at-least-once redelivery a re-run could double-apply it — confirm it's safe to re-run, or add an exists/dedup check, an upsert, an idempotency-key/inbox, or a versioned write. — Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WebSocket/CustomNetCoreWebSocketMessageHandler.cs:31
What to do
Make retry-prone mutations idempotent — guard each write with an exists/dedup check, an upsert, an idempotency-key/inbox, or a versioned write, so a re-run doesn't double-apply.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×3) — src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs:89, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundRequestHandler.cs:59, src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/ContainerCacheStrategy/DaprContainerCacheStrategy.cs:117
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
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.
`GetAll` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/ContainerCacheStrategy/DaprContainerCacheStrategy.cs:117, src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs:89
`OnEvent_ShakearoundUserShakeRequestAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs:558
`ListAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Template/TemplateApi.cs:196
`DelAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Template/TemplateApi.cs:209
`SetParameter` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundRequestHandler.cs:59
A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×34) — src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Helpers/WebSocketHelper.cs:84, src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:44, src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:45, …
What to do
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 24 of 35 project(s) that lack one — worth up to 1.4 pts.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
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. Exhaustive, deterministic.
27531/27782 types (99%) are public. For a library, every public type is a stability contract — make internal-by-default and expose only the intended API.
What to do
Make types internal by default; expose only the deliberate public API so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability4.9 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 8/27 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 27, 8 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
What to do
Extend structured logging across the projects you operate, and give the library ones a diagnostics seam instead — an `EventSource`/`ActivitySource` the host can subscribe to, or an optional logger on your options object — rather than taking a logging dependency on your consumers' behalf.
Consider OpenTelemetry tracing/metrics and a health-check endpoint for operability.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (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 13936 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.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's csharp pack, or a .NET security analyzer package — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Roslyn scan: Polly resilience markers (Retry, CircuitBreaker, Timeout) on outbound HTTP invocations. Computed per type, deterministic.
Outbound HTTP calls were found with no timeout or retry policy around them. This codebase ships libraries/tools rather than a service it operates, so the failure lands differently: an unbounded call hangs the caller's process — a build step, a CLI run, a UI thread — with no way out.
What to do
Give every outbound call a bound the caller can rely on: set an explicit `HttpClient.Timeout` (or pass a `CancellationToken` from a `CancellationTokenSource` with a deadline) and flow the caller's own `CancellationToken` through, so a slow endpoint fails fast instead of hanging.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
What to do
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Raise allocation-aware density on the hot paths — currently 7 use(s) across 280,899 production line(s) (~0.0/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) that wastes threads and risks deadlock, and, where the code is a reusable library, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) counted everywhere, and — for a library with ≥5 awaits — the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
22 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Only 2023/2942 awaits use ConfigureAwait(false). A library that captures the caller's context can stall or deadlock its host — the classic way a dependency drags an app down.
What to do
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
In library code, append .ConfigureAwait(false) to every await (or set <ConfigureAwait>false</ConfigureAwait> / use the analyzer CA2007) so the library never captures the host's context.
Do you agree with this assessment?
R1 · Type Safety1.4 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
4 typed · 24 plain JS — the untyped files are src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/app.js, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/LivePusher/LivePusher.js, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/Login/Login.js, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/QrCode/QrCode.js, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/logs/logs.js (+18 more).
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
Samples/WxOpen/Senparc.Weixin.WxOpen.AppDemo/ and src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/ are near-verbatim copies of each other: 36 files are byte-identical under the same relative paths (~9924 lines; the trees hold 43 and 70 files). That is one structural fact, not 36 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/signalr.test.js:1
src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:2 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:2 — these 2 files are line-for-line copies of one another — 392 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:2
src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/components/create/createstep.js:3 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/components/create/createstep.js:3 — these 2 files are line-for-line copies of one another — 201 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/components/create/createstep.js:3
src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/stores/projectStores.js:3 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/stroes/projectStores.js:3 — these 2 files are line-for-line copies of one another — 101 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/stores/projectStores.js:3
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket/websocket.js:3 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket_signalr/websocket_signalr.js:4 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket/websocket.js:3
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/login-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:7 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.1.0.js:4 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.2.0.js:4 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.1.0.js:4
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:136 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:136
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/login-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/message-list-card/index.js:8 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:7 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/Login/Login.js:20 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:389 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/Login/Login.js:20
tools/WeixinDev/src/interfaceInserter.ts:33 · tools/WeixinDev/src/sidebarProvider.ts:60 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — tools/WeixinDev/src/interfaceInserter.ts:33
src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:41 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:34 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:41
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
s has cyclomatic complexity 18 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:88, src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:88
a has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:36, src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:36
(anonymous) has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/WeixinDev/src/extension.ts:44
on has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:457, src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:457
(anonymous) has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:434, src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:434
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files8.6 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 14 application, 1 tooling and 0 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×9) — src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js, src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js, tools/WeixinDev/src/sidebarProvider.ts, …
no import path from any entry point (14 application, 1 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (tools/WeixinDev/src/interfaceInserter.ts, tools/WeixinDev/src/sidebarProvider.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — tools/WeixinDev/src/apiService.ts
no import path from any entry point (14 application, 1 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (tools/WeixinDev/src/sidebarProvider.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — tools/WeixinDev/src/interfaceInserter.ts
tools/WeixinDev/package.json contributes this command, so VS Code offers it in the palette and in every menu or keybinding that cites it — but no source file calls registerCommand with this id, and the id occurs in no source string at all; invoking it fails with "command 'weixindev.openSidebar' not found". The source does register 1 command(s) by literal ('weixindev.insertWeixinInterface'), which is what makes the absence provable. Register it at activation, or delete the contribution together with the menu and keybinding entries that reference it. — tools/WeixinDev/package.json
tools/WeixinDev/package.json contributes this command, so VS Code offers it in the palette and in every menu or keybinding that cites it — but no source file calls registerCommand with this id, and the id occurs in no source string at all; invoking it fails with "command 'weixindev.refreshWebview' not found". The source does register 1 command(s) by literal ('weixindev.insertWeixinInterface'), which is what makes the absence provable. Register it at activation, or delete the contribution together with the menu and keybinding entries that reference it. — tools/WeixinDev/package.json
tools/WeixinDev/out/extension-backup.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-backup.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it. — tools/WeixinDev/out/extension-backup.js.map
tools/WeixinDev/out/extension-complex.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-complex.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it. — tools/WeixinDev/out/extension-complex.js.map
tools/WeixinDev/out/extension-minimal.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-minimal.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it. — tools/WeixinDev/out/extension-minimal.js.map
tools/WeixinDev/out/extension-simple.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-simple.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it. — tools/WeixinDev/out/extension-simple.js.map
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in tools/WeixinBrowserPlugin/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored.
MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. This repository constructs a collision-broken hash (MD5/SHA1) at 7 sites, not one: `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CheckSignature.cs:107` (SHA1), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:133` (MD5), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:135` (SHA1), `REDACTED:353` (SHA1CryptoServiceProvider), `REDACTED:355` (SHA1), `REDACTED:285` (SHA1CryptoServiceProvider), `REDACTED:287` (SHA1). Each is a separate decision — fixing only the line this row cites leaves the others in place. — REDACTED:353
A digest from `GenarateSinature` (MD5/SHA1) is compared against an expected value here, and a mismatch rejects the input — so a collision-broken hash IS the integrity check. — src/Senparc.Weixin.Work.Middleware/MessageHandlers/Middleware/WorkMessageHandlerMiddleware.cs:115
DES / 3DES / RijndaelManaged-bare is deprecated or broken. Use AES-GCM via `Aes.Create()` with explicit key/iv sizes. This repository constructs a broken or deprecated cipher at 7 sites, not one: `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:126` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:158` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:233` (RijndaelManaged), `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:132` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:146` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:178` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:253` (RijndaelManaged). Each is a separate decision — fixing only the line this row cites leaves the others in place. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:126
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name. This repository constructs a collision-broken hash (MD5/SHA1) at 7 sites, not one: `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CheckSignature.cs:107` (SHA1), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:133` (MD5), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:135` (SHA1), `REDACTED:353` (SHA1CryptoServiceProvider), `REDACTED:355` (SHA1), `REDACTED:285` (SHA1CryptoServiceProvider), `REDACTED:287` (SHA1). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Verify integrity with SHA-256+ rather than MD5/SHA1: a collision-broken digest cannot establish that content matches what was expected, since an attacker able to influence the content can produce a colliding replacement. Where the content is downloaded or otherwise attacker-reachable, prefer an authenticated check — a signature over the digest, or the publisher's SHA-256 fetched over a channel the content itself does not come from. The gate is at `src/Senparc.Weixin.Work.Middleware/MessageHandlers/Middleware/WorkMessageHandlerMiddleware.cs:115`.
Replace DES/3DES (and bare RijndaelManaged) with AES-GCM via `Aes.Create()`. This repository constructs a broken or deprecated cipher at 7 sites, not one: `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:126` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:158` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:233` (RijndaelManaged), `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:132` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:146` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:178` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:253` (RijndaelManaged). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×22) — src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/AccessTokenContainer.cs:222, src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/JsApiTicketContainer.cs:154, src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/ProviderTokenContainer.cs:150, …
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. Deterministic, provable per finding. Advisory.
`sha1` is a `SHA1`, which implements `IDisposable`, and it is created here (line 107). Every use of it in `GetSignature` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sha1 = …;`), which releases it at the end of the scope on every path including a throw. — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CheckSignature.cs:107
`aes` is a `RijndaelManaged`, which implements `IDisposable`, and it is created here (line 132). Every use of it in `AES_Decrypt` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var aes = …;`), which releases it at the end of the scope on every path including a throw. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:132
`cs` is a `CryptoStream`, which implements `IDisposable`, and it is created here (line 184). Every use of it in `AES_Decrypt` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cs = …;`), which releases it at the end of the scope on every path including a throw. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:184
`fs` is a `FileStream`, which implements `IDisposable`, and it is created here (line 139). Every use of it in `Download` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fs = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/DocumentController.cs:139
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 102). Every use of it in `Index` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:102
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 264). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:264
`fileStream` is a `MemoryStream`, which implements `IDisposable`, and it is created here (line 266). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fileStream = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:266
`streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 910). Every use of it in `SendGroupRedPack` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:910
`streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 958). Every use of it in `GetHBInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:958
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 1022). Every use of it in `ProductPayCode` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1022
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 27). Every use of it in `GerQrCodeStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. (×2) — Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:27, Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:27
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 345). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:345
`fileStream` is a `MemoryStream`, which implements `IDisposable`, and it is created here (line 347). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fileStream = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:347
`streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 914). Every use of it in `SendGroupRedPack` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:914
`streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 962). Every use of it in `GetHBInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:962
`bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 1026). Every use of it in `ProductPayCode` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:1026
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage.
Only 50/1634 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — this work can't be stopped early once started. (×39) — src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/App/AppApi.cs:127, src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/App/AppApi.cs:146, src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/App/AppApi.cs:167, …
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
The guard on line 1279 rejects `appKey` and line 1281 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(appKey)` is true of a value that is NOT null: it is satisfied by an EMPTY `appKey`, and on that path `appKey` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1281
The guard on line 1283 rejects `uri` and line 1285 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(uri)` is true of a value that is NOT null: it is satisfied by an EMPTY `uri`, and on that path `uri` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1285
The guard on line 1314 rejects `sessionKey` and line 1316 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(sessionKey)` is true of a value that is NOT null: it is satisfied by an EMPTY `sessionKey`, and on that path `sessionKey` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1316
What to do
Each finding names the throw and the test in its own condition that is true of a NON-null value. Confirm from the two, then throw the exception that describes what was actually wrong: `ArgumentException` for a value that arrived empty, or the .NET 8 helpers that spell the whole guard in one line and pick the type for you — `ArgumentException.ThrowIfNullOrEmpty(s)` / `ThrowIfNullOrWhiteSpace(s)` for strings, `ArgumentNullException.ThrowIfNull(x)` followed by `ArgumentOutOfRangeException.ThrowIfZero(x.Count)` for a collection. Splitting the two conditions is usually clearer than picking one exception for both: they are different failures and the caller may want to handle them differently.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere. 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. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness 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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×12) — REDACTED:98, REDACTED:133, REDACTED:153, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×5) — src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:151, src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:183, src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:106, …
`catch (System.Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/TenPayV3Results.cs:189
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:59, Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:140
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. Deterministic.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This method contradicts itself about `fullButton`: line 140 assigns it with `as Dictionary<string, object>`, which hands back null rather than throwing when the value is not a `Dictionary<string, object>`, but line 141 then dereferences it directly as `fullButton.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `fullButton` once before the first use and handle the null case, or cast with `(Dictionary<string, object>)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:141
This method contradicts itself about `strongRequestMessage`: line 200 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 203 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:203
This method contradicts itself about `ccRequestMessage`: line 264 assigns it with `as IRequestMessageEvent_Change_Contact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_Contact_Base`, but line 266 then dereferences it directly as `ccRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `ccRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_Contact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:266
This method contradicts itself about `cecRequestMessage`: line 310 assigns it with `as IRequestMessageEvent_Change_ExternalContact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_ExternalContact_Base`, but line 312 then dereferences it directly as `cecRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cecRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_ExternalContact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:312
This method contradicts itself about `cechat`: line 353 assigns it with `as RequestMessageEvent_Change_External_Chat_Base`, which hands back null rather than throwing when the value is not a `RequestMessageEvent_Change_External_Chat_Base`, but line 355 then dereferences it directly as `cechat.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cechat` once before the first use and handle the null case, or cast with `(RequestMessageEvent_Change_External_Chat_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:355
This method contradicts itself about `tag`: line 379 assigns it with `as RequestMessageEvent_Change_External_Tag_Base`, which hands back null rather than throwing when the value is not a `RequestMessageEvent_Change_External_Tag_Base`, but line 381 then dereferences it directly as `tag.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `tag` once before the first use and handle the null case, or cast with `(RequestMessageEvent_Change_External_Tag_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:381
This method contradicts itself about `cecRequestMessage`: line 1238 assigns it with `as IRequestMessageEvent_Change_ExternalContact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_ExternalContact_Base`, but line 1240 then dereferences it directly as `cecRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cecRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_ExternalContact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:1240
This method contradicts itself about `sLeft`: line 299 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 301 then dereferences it directly as `sLeft.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sLeft` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:301
This method contradicts itself about `sRight`: line 300 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 302 then dereferences it directly as `sRight.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sRight` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:302
This method contradicts itself about `sLeft`: line 231 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 233 then dereferences it directly as `sLeft.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sLeft` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:233
This method contradicts itself about `sRight`: line 232 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 234 then dereferences it directly as `sRight.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sRight` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:234
This method contradicts itself about `fullButton`: line 184 assigns it with `as Dictionary<string, object>`, which hands back null rather than throwing when the value is not a `Dictionary<string, object>`, but line 185 then dereferences it directly as `fullButton.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `fullButton` once before the first use and handle the null case, or cast with `(Dictionary<string, object>)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:185
This method contradicts itself about `strongRequestMessage`: line 52 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 56 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs:56
This method contradicts itself about `strongRequestMessage`: line 54 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 58 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs:58
This method contradicts itself about `strongRequestMessage`: line 83 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 85 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:85
This method contradicts itself about `strongRequestMessage`: line 501 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 503 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:503
This method contradicts itself about `baseCacheStrategy`: line 135 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 138 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side. (×2) — src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:138, src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:138
This method contradicts itself about `baseCacheStrategy`: line 164 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 167 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side. (×2) — src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:167, src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:167
This method contradicts itself about `openId`: line 47 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 49 then dereferences it directly as `openId.IsNullOrEmpty` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `openId` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/AsyncMethodsController.cs:49
This method contradicts itself about `addConditionalButtonGroup`: line 131 assigns it with `as ConditionalButtonGroup`, which hands back null rather than throwing when the value is not a `ConditionalButtonGroup`, but line 132 then dereferences it directly as `addConditionalButtonGroup.matchrule` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `addConditionalButtonGroup` once before the first use and handle the null case, or cast with `(ConditionalButtonGroup)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:132
This method contradicts itself about `strongRequestMessage`: line 69 assigns it with `as RequestMessageText`, which hands back null rather than throwing when the value is not a `RequestMessageText`, but line 75 then dereferences it directly as `strongRequestMessage.Content` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(RequestMessageText)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:75
This method contradicts itself about `strongRequestMessage`: line 87 assigns it with `as RequestMessageImage`, which hands back null rather than throwing when the value is not a `RequestMessageImage`, but line 94 then dereferences it directly as `strongRequestMessage.PicUrl` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(RequestMessageImage)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:94
This method contradicts itself about `workSetting`: line 174 assigns it with `as ISenparcWeixinSettingForWork`, which hands back null rather than throwing when the value is not a `ISenparcWeixinSettingForWork`, but line 178 then dereferences it directly as `workSetting.WeixinCorpId` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `workSetting` once before the first use and handle the null case, or cast with `(ISenparcWeixinSettingForWork)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:178
This method contradicts itself about `data`: line 449 writes `data?.sp_mchid`, which says `data` can be null, but line 449 then dereferences it directly as `data.order_no` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `data` truly cannot be null here, the `?.` is misleading. Settle it one way — test `data` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:449
This method contradicts itself about `data`: line 472 writes `data?.sp_mchid`, which says `data` can be null, but line 472 then dereferences it directly as `data.order_no` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `data` truly cannot be null here, the `?.` is misleading. Settle it one way — test `data` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:472
This method contradicts itself about `data`: line 544 writes `data?.sp_mchid`, which says `data` can be null, but line 544 then dereferences it directly as `data.out_trade_no` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `data` truly cannot be null here, the `?.` is misleading. Settle it one way — test `data` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:544
This method contradicts itself about `certificate`: line 227 writes `certificate?.ResultCode`, which says `certificate` can be null, but line 230 then dereferences it directly as `certificate.data` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `certificate` truly cannot be null here, the `?.` is misleading. Settle it one way — test `certificate` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — REDACTED:230
This method contradicts itself about `workSetting`: line 35 assigns it with `as ISenparcWeixinSettingForWork`, which hands back null rather than throwing when the value is not a `ISenparcWeixinSettingForWork`, but line 43 then dereferences it directly as `workSetting.WeixinCorpId` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `workSetting` once before the first use and handle the null case, or cast with `(ISenparcWeixinSettingForWork)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:43
8/12 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
What to do
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
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).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 28 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.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
D25 ADR Conformance — no ADRs to check
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.
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.
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (a Domain/Aggregates/ValueObjects layer)
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): a message-bus package; 33 CQRS handler(s)
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no EF Core usage detected
P9 Domain vs controller coverage — coverage data present for 3 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (34 production file(s)) has no JavaScript/TypeScript test, but it is 13.23% of this repository's production source and the other 86.77% carries 41,109 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Orphaned knowledge src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/TenPayV3Results.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Tcb/TcbApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/PayScoreApis.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CreateServiceOrderReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/PayNotifyJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateServiceOrderRequestData.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CompleteServiceOrderReturnJson.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Wxa/WxaApi.cs— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
WriteOnlyPrivateField Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/CaseCollectionController.cs:13— private Microsoft.AspNetCore.Hosting.IHostingEnvironment _env — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/HomeController.cs:29— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/MP/Senparc.Weixin.Sample.MP.Simple/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/MP/Senparc.Weixin.Sample.MP/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/Work/Senparc.Weixin.Sample.Work/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/Controllers/HomeController.cs:9— private ILogger<HomeController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/AsyncMethodsController.cs:16— private string appSecret — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayHttpClient.cs:98— private string CaFile — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:104— private string Charset — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Apis/Complaint/ComplaintApisTests.cs:24— private string openId — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
Assertions commented out: ContextTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/MessageHandlers/MessageHandlersTest.cs:269— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: RestoreTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/MessageHandlers/MessageHandlersTest.cs:318— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: MutipleThreadsTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/MessageHandlers/MessageHandlersTest.cs:328— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: RegisterContainerCacheStrategyTest src/Senparc.Weixin/Senparc.WeixinTests/Cache/CacheStrategyFactoryTests.cs:35— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: GetCollectionListTest src/Senparc.Weixin/Senparc.WeixinTests/Containers/BaseContainerTests.cs:63— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
EmptyCatchBlock Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:582— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
EmptyCatchBlock Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:230— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
EmptyCatchBlock src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:106— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
EmptyCatchBlock src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:151— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
EmptyCatchBlock src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:183— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
D10 · Test Quality· No assertions (empty test) · ×4
No assertions (empty test): GetAuthorizeUrlTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/OAuth/OAuthTest.cs:33— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): LockTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/Containers/AccessTokenContainerLockTest.cs:34— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): OrderQueryTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/TenPayLibV3/TenPayV3/TenPayTest.cs:33— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): DownLoadTest src/Senparc.Weixin/Senparc.WeixinTests/Utilities/HttpUtility/PostTests.cs:102— Test method has an empty body — it asserts nothing and exercises no code.
BlanketAnalyzerSeverityNone eng/Quality/quality.globalconfig:5— dotnet_analyzer_diagnostic.severity = none — every analyzer rule — this is not one rule switched off, it is a whole set the file never lists: every rule the entry covers is silenced for every file the section matches, in every project under this directory, and any rule added to that set by a future analyzer upgrade is silenced too, without anybody deciding so. It reads as narrower than it is — the analyzers still run and the build still looks configured — and because no rule is named there is nothing for a reader to look up and no list that will ever disclose what is covered. Replace it with the rules you actually mean to switch off, each on its own line, so the set is finite, visible and reviewable, and the ones nobody chose keep protecting the tree. If the blanket entry is genuinely right, link the decision from a comment above it: a comment that only restates the entry is what the editor generates when it writes this line, so it is a reference to the decision — an issue or a ticket — that clears this row.
S1 · Cryptographic Hygiene· Weak hash is the integrity check · ×1
Weak hash is the integrity check src/Senparc.Weixin.Work.Middleware/MessageHandlers/Middleware/WorkMessageHandlerMiddleware.cs:115— A digest from `GenarateSinature` (MD5/SHA1) is compared against an expected value here, and a mismatch rejects the input — so a collision-broken hash IS the integrity check.
TodoComment Samples/All/Senparc.Weixin.Sample.CommonService/EventService.cs:163— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageContext.cs:46— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageContext.cs:41— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageContext.cs:45— //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 Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageContext.cs:46— //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 Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageContext.cs:41— //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 Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageContext.cs:45— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:662— //TODO: 对Event信息进行统一操作 — 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 Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:310— //TODO: 对Event信息进行统一操作 — 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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WebSocket/CustomNetCoreWebSocketMessageHandler.cs:20— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WebSocket/CustomNetCoreWebSocketMessageHandler.cs:26— //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 Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:111— //TODO:这里的逻辑可以交给Service处理具体信息,参考OnLocationRequest方法或/Service/LocationSercice.cs — 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 Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:104— //TODO:这里的逻辑可以交给Service处理具体信息,参考OnLocationRequest方法或/Service/LocationSercice.cs — 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 REDACTED:153— //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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:160— //TODO:根据"conditionalmenu"判断自定义菜单 — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:68— //TODO:交给Service处理具体信息,参考/Service/EventSercice.cs 及 /Service/LocationSercice.cs — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:86— //TODO:交给Service处理具体信息 — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:109— //TODO:交给Service处理具体信息 — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/Open/OpenOAuthController.cs:45— ////TODO:储存oauthResult.authorization_info — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/Open/OpenOAuthController.cs:179— //TODO:使用Container — 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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:489— //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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1149— //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 REDACTED:1153— //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 Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:460— //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 Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:581— //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.
TooManyMethods: MeetingApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingApi.Layout.cs— TooManyMethods — 1101 significant lines (blank, comment-only and punctuation-only lines excluded), 214 methods, declared across 12 files: Meeting/MeetingApi.Layout.cs (32), Meeting/MeetingApi.Webinar.cs (28), Meeting/MeetingApi.cs (26), Meeting/MeetingApi.Rooms.cs (24), +8 more file(s). The bar is 30 methods; this is 184 over it, 7.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WorkMessageHandler src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/WorkMessageHandler.cs— TooManyMethods — 993 significant lines (blank, comment-only and punctuation-only lines excluded), 189 methods, declared across 2 files: MessageHandlers/WorkMessageHandler.cs (96), Async/WorkMessageHandler.Async.cs (93). The bar is 30 methods; this is 159 over it, 6.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExternalApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalApi.cs— TooManyMethods — 953 significant lines (blank, comment-only and punctuation-only lines excluded), 178 methods, declared across 6 files: External/ExternalApi.cs (84), External/ExternalCustomerManagementApi.cs (24), External/ExternalMomentApi.cs (24), External/ExternalCatalogApi.cs (22), +2 more file(s). The bar is 30 methods; this is 148 over it, 5.93× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: MessageHandler src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs— TooManyMethods — 825 significant lines (blank, comment-only and punctuation-only lines excluded), 155 methods, declared across 6 files: Async/MessageHandlerAsync.Event.cs (61), MessageHandlers/MessageHandler.Event.cs (61), Async/MessageHandlerAsync.Message.cs (12), MessageHandlers/MessageHandler.Message.cs (11), +2 more file(s). The bar is 30 methods; this is 125 over it, 5.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WeDocApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeDoc/WeDocApi.SmartDoc.cs— TooManyMethods — 514 significant lines (blank, comment-only and punctuation-only lines excluded), 133 methods, declared across 11 files: WeDoc/WeDocApi.SmartDoc.cs (34), WeDoc/WeDocApi.cs (33), WeDoc/WeDocApi.SmartSheet.cs (12), WeDoc/WeDocApi.Form.cs (10), +7 more file(s). The bar is 30 methods; this is 103 over it, 4.43× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: MiniDramaApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/MiniDrama/MiniDramaApi.cs— TooManyMethods — 224 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods, declared across 4 files: MiniDrama/MiniDramaApi.cs (29), MiniDrama/MiniDramaAuthorizationApi.cs (22), MiniDrama/MiniDramaAuditApi.cs (20), MiniDrama/MiniDramaPlayerApi.cs (18). The bar is 30 methods; this is 59 over it, 2.97× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: SchoolApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/School/SchoolApi.User.cs— TooManyMethods — 322 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods, declared across 3 files: School/SchoolApi.User.cs (38), School/SchoolApi.cs (25), School/SchoolApi.Service.cs (22). The bar is 30 methods; this is 55 over it, 2.83× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WxOpenMessageHandler src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs— TooManyMethods — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods, declared across 3 files: MessageHandlers/WxOpenMessageHandler.Event.cs (68), MessageHandlers/WxOpenMessageHandler.cs (9), MessageHandlers/WxOpenMessageHandler.Message.cs (6). The bar is 30 methods; this is 53 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CloudBaseApi src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseApi.cs— TooManyMethods — 307 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: XPayApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs— TooManyMethods — 419 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods, declared across 2 files: XPay/XPayApi.cs (73), XPay/XPayIncrementApi.cs (8). The bar is 30 methods; this is 51 over it, 2.70× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: LiveBroadcastApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastApi.cs— TooManyMethods — 184 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods, declared across 3 files: LiveBroadcast/LiveBroadcastApi.cs (57), LiveBroadcast/LiveBroadcastGoodsApi.cs (14), LiveBroadcast/LiveBroadcastRoleSubscriptionApi.cs (10). The bar is 30 methods; this is 51 over it, 2.70× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: TenPayV3 src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs— TooManyMethods — 659 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods, declared across 3 files: Universal/TenPayV3.cs (64), Customs/TenPayV3.Customs.cs (10), Universal/TenpayV3.PayBank.cs (6). The bar is 30 methods; this is 50 over it, 2.67× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WeixinExpressApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressIntracityApi.cs— TooManyMethods — 168 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods, declared across 4 files: WeixinExpress/WeixinExpressIntracityApi.cs (32), WeixinExpress/WeixinExpressInsuranceApi.cs (22), WeixinExpress/WeixinExpressApi.cs (16), WeixinExpress/WeixinExpressReturnApi.cs (6). The bar is 30 methods; this is 46 over it, 2.53× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: CloudBaseBatchApi src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBaseBatch/CloudBaseBatchApi.cs— TooManyMethods — 273 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: B2BApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/B2B/B2BOrderApi.cs— TooManyMethods — 158 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods, declared across 4 files: B2B/B2BOrderApi.cs (20), B2B/B2BMerchantApi.cs (18), B2B/B2BProfitSharingApi.cs (18), B2B/B2BApi.cs (15). The bar is 30 methods; this is 41 over it, 2.37× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: EcommerceApis src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/EcommerceApis.AccountFunds.cs— TooManyMethods — 436 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods, declared across 6 files: Ecommerce/EcommerceApis.AccountFunds.cs (18), Ecommerce/EcommerceApis.MerchantCancellation.cs (15), Ecommerce/EcommerceApis.Refunds.cs (11), Ecommerce/EcommerceApis.CrossBorder.cs (9), +2 more file(s). The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChatDataApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/DataIntelligence/ChatDataApi.cs— TooManyMethods — 299 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WeDriveApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeDrive/WeDriveApi.File.cs— TooManyMethods — 238 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods, declared across 3 files: WeDrive/WeDriveApi.File.cs (34), WeDrive/WeDriveApi.cs (20), WeDrive/WeDriveApi.Management.cs (10). The bar is 30 methods; this is 34 over it, 2.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WxAppApi src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs— TooManyMethods — 615 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: WeChatCustomerServiceApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeChatCustomerService/WeChatCustomerServiceApi.cs— TooManyMethods — 130 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods, declared across 2 files: WeChatCustomerService/WeChatCustomerServiceApi.cs (58), WeChatCustomerService/WeChatCustomerServiceQualificationApi.cs (2). The bar is 30 methods; this is 30 over it, 2.00× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: LicenseApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/License/LicenseApi.Order.cs— TooManyMethods — 347 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, declared across 4 files: License/LicenseApi.Order.cs (26), License/LicenseApi.Account.cs (18), License/LicenseApi.Settings.cs (10), License/LicenseApi.cs (4). The bar is 30 methods; this is 28 over it, 1.93× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ProductCouponApis src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ProductCoupon/ProductCouponApis.cs— TooManyMethods — 369 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpenHardwareApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/OpenHardware/OpenHardwareApi.Device.cs— TooManyMethods — 318 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods, declared across 5 files: OpenHardware/OpenHardwareApi.Device.cs (24), OpenHardware/OpenHardwareApi.Attendance.cs (10), OpenHardware/OpenHardwareApi.Printer.cs (10), OpenHardware/OpenHardwareApi.cs (6), +1 more file(s). The bar is 30 methods; this is 25 over it, 1.83× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ExmailApi REDACTED— TooManyMethods — 220 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods, declared across 5 files: REDACTED (15), Exmail/ExmailApi.cs (14), Exmail/ExmailApi.Group.cs (12), Exmail/ExmailApi.Account.cs (8), +1 more file(s). The bar is 30 methods; this is 25 over it, 1.83× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: AmsApi src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Ams/AmsApi.cs— TooManyMethods — 219 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×30
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:141— This method contradicts itself about `fullButton`: line 140 assigns it with `as Dictionary<string, object>`, which hands back null rather than throwing when the value is not a `Dictionary<string, object>`, but line 141 then dereferences it directly as `fullButton.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `fullButton` once before the first use and handle the null case, or cast with `(Dictionary<string, object>)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:203— This method contradicts itself about `strongRequestMessage`: line 200 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 203 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:266— This method contradicts itself about `ccRequestMessage`: line 264 assigns it with `as IRequestMessageEvent_Change_Contact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_Contact_Base`, but line 266 then dereferences it directly as `ccRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `ccRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_Contact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:312— This method contradicts itself about `cecRequestMessage`: line 310 assigns it with `as IRequestMessageEvent_Change_ExternalContact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_ExternalContact_Base`, but line 312 then dereferences it directly as `cecRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cecRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_ExternalContact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:355— This method contradicts itself about `cechat`: line 353 assigns it with `as RequestMessageEvent_Change_External_Chat_Base`, which hands back null rather than throwing when the value is not a `RequestMessageEvent_Change_External_Chat_Base`, but line 355 then dereferences it directly as `cechat.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cechat` once before the first use and handle the null case, or cast with `(RequestMessageEvent_Change_External_Chat_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:381— This method contradicts itself about `tag`: line 379 assigns it with `as RequestMessageEvent_Change_External_Tag_Base`, which hands back null rather than throwing when the value is not a `RequestMessageEvent_Change_External_Tag_Base`, but line 381 then dereferences it directly as `tag.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `tag` once before the first use and handle the null case, or cast with `(RequestMessageEvent_Change_External_Tag_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:1240— This method contradicts itself about `cecRequestMessage`: line 1238 assigns it with `as IRequestMessageEvent_Change_ExternalContact_Base`, which hands back null rather than throwing when the value is not a `IRequestMessageEvent_Change_ExternalContact_Base`, but line 1240 then dereferences it directly as `cecRequestMessage.ChangeType` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `cecRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEvent_Change_ExternalContact_Base)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded REDACTED:301— This method contradicts itself about `sLeft`: line 299 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 301 then dereferences it directly as `sLeft.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sLeft` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded REDACTED:302— This method contradicts itself about `sRight`: line 300 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 302 then dereferences it directly as `sRight.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sRight` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded REDACTED:233— This method contradicts itself about `sLeft`: line 231 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 233 then dereferences it directly as `sLeft.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sLeft` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded REDACTED:234— This method contradicts itself about `sRight`: line 232 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 234 then dereferences it directly as `sRight.Length` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `sRight` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:185— This method contradicts itself about `fullButton`: line 184 assigns it with `as Dictionary<string, object>`, which hands back null rather than throwing when the value is not a `Dictionary<string, object>`, but line 185 then dereferences it directly as `fullButton.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `fullButton` once before the first use and handle the null case, or cast with `(Dictionary<string, object>)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs:56— This method contradicts itself about `strongRequestMessage`: line 52 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 56 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs:58— This method contradicts itself about `strongRequestMessage`: line 54 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 58 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:85— This method contradicts itself about `strongRequestMessage`: line 83 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 85 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:503— This method contradicts itself about `strongRequestMessage`: line 501 assigns it with `as IRequestMessageEventBase`, which hands back null rather than throwing when the value is not a `IRequestMessageEventBase`, but line 503 then dereferences it directly as `strongRequestMessage.Event` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(IRequestMessageEventBase)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:138— This method contradicts itself about `baseCacheStrategy`: line 135 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 138 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:167— This method contradicts itself about `baseCacheStrategy`: line 164 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 167 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/AsyncMethodsController.cs:49— This method contradicts itself about `openId`: line 47 assigns it with `as string`, which hands back null rather than throwing when the value is not a `string`, but line 49 then dereferences it directly as `openId.IsNullOrEmpty` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `openId` once before the first use and handle the null case, or cast with `(string)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:132— This method contradicts itself about `addConditionalButtonGroup`: line 131 assigns it with `as ConditionalButtonGroup`, which hands back null rather than throwing when the value is not a `ConditionalButtonGroup`, but line 132 then dereferences it directly as `addConditionalButtonGroup.matchrule` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `addConditionalButtonGroup` once before the first use and handle the null case, or cast with `(ConditionalButtonGroup)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:75— This method contradicts itself about `strongRequestMessage`: line 69 assigns it with `as RequestMessageText`, which hands back null rather than throwing when the value is not a `RequestMessageText`, but line 75 then dereferences it directly as `strongRequestMessage.Content` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(RequestMessageText)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController_OldPost.cs:94— This method contradicts itself about `strongRequestMessage`: line 87 assigns it with `as RequestMessageImage`, which hands back null rather than throwing when the value is not a `RequestMessageImage`, but line 94 then dereferences it directly as `strongRequestMessage.PicUrl` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `strongRequestMessage` once before the first use and handle the null case, or cast with `(RequestMessageImage)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded REDACTED:178— This method contradicts itself about `workSetting`: line 174 assigns it with `as ISenparcWeixinSettingForWork`, which hands back null rather than throwing when the value is not a `ISenparcWeixinSettingForWork`, but line 178 then dereferences it directly as `workSetting.WeixinCorpId` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `workSetting` once before the first use and handle the null case, or cast with `(ISenparcWeixinSettingForWork)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:138— This method contradicts itself about `baseCacheStrategy`: line 135 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 138 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisHashSetContainerCacheStrategy.cs:167— This method contradicts itself about `baseCacheStrategy`: line 164 assigns it with `as RedisHashSetObjectCacheStrategy`, which hands back null rather than throwing when the value is not a `RedisHashSetObjectCacheStrategy`, but line 167 then dereferences it directly as `baseCacheStrategy.GetFinalKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseCacheStrategy` once before the first use and handle the null case, or cast with `(RedisHashSetObjectCacheStrategy)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/AccessTokenContainer.cs:222— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/JsApiTicketContainer.cs:154— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/ProviderTokenContainer.cs:150— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:345— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:356— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs:522— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:162— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:141— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs:141— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/WxCardApiTicketContainer.cs:110— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:292— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/AuthorizerContainer.cs:192— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/AuthorizerContainer.cs:236— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/ComponentContainer.cs:228— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/ComponentContainer.cs:275— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.Open/Senparc.Weixin.Open/MessageHandlers/ThirdPartyMessageHandler.cs:102— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs:88— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:726— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:341— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) Samples/All/Senparc.Weixin.Sample.CommonService/TemplateMessageService.cs:70— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayNotifyHandler.cs:112— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayNotifyHandler.cs:123— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
No assertions: CreateWxaQrCodeTest2 src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/AdvancedAPIs/WxApp/WxAppApiTests.cs:60— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: MediaCheckAsyncTest src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/AdvancedAPIs/WxApp/WxAppApiTests.cs:173— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: SerializeDataTest src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/SerializeTest.cs:42— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: SerializeCompareTest src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/SerializeTest.cs:55— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: MyTestMethod src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/WeixinRegisterTests.cs:22— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestRegisterMpAccount src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/WeixinRegisterTests.cs:31— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: GetAuthorizerInfoTest src/Senparc.Weixin.Open/Senparc.Weixin.Open.Test/ComponentAPIs/ComponentApi.cs:11— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: GetXmlValuesTest src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.Test/V3/TenPayV3ResultTest.cs:10— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: GetXmlValuesTest1 src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.Test/V3/TenPayV3ResultTest.cs:32— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: Markdown2Test src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/Webhook/WebhookApiTests.cs:33— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: FileTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/MessageHandlers/WorkMessageHandlerTest.cs:132— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TestMethod1 src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/AsyncTest.cs:18— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: GetFullUserTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/User/CustomTest.cs:68— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: LocalCacheDeadLockTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CacheTests/CacheTests.cs:43— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: LocalCacheDeadLockInGetTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CacheTests/CacheTests.cs:62— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: MessageHandlerMiddlewareInvokeTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/MessageHandlers/Middleware/MessageHandlerMiddlewareTests.cs:37— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: LocalCacheLockTest src/Senparc.Weixin/Senparc.WeixinTests/Cache.Local/Lock/LocalCacheLockTests.cs:35— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: DownloadTest src/Senparc.Weixin/Senparc.WeixinTests/Utilities/HttpUtility/GetTests.cs:35— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: SetHttpProxyTest src/Senparc.Weixin/Senparc.WeixinTests/Utilities/HttpUtility/RequestUtilityTests.cs:37— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Duplicated block (18 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingManagementJson.cs:61— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingManagementJson.cs:61-78 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingManagementJson.cs:87-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:59— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:59-76 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:345-362 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:77` calls `ResponseMessageMpNews` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:363` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:72— src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:72-89 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/ResponseMessageFactory.cs:33-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:72` 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 (18 lines × 2) REDACTED:298— REDACTED:298-315 | REDACTED:230-247 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:155— src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:155-172 | src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:305-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:358— src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:358-375 | src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:411-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/CommonJsonSend.cs:358` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1326— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1326-1343 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3489-3506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:995— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:995-1012 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:1998-2015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:995` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:262— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:262-279 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs:222-239 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:262` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs:82— src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs:82-99 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/RequestMessageFactory.cs:77-94 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/RequestMessageFactory.cs` as WHOLE FILES: 90% 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 2 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Code/CodeApi.cs:162— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Code/CodeApi.cs:162-179 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Code/CodeApi.cs:519-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Code/CodeApi.cs:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:147— src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:147-164 | src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:148-165 — before extracting anything, compare `src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs` and `src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs` as WHOLE FILES: 98% 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 2 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 (18 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:271— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:271-288 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:328-345 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs:171— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs:171-188 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:182-199 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs` as WHOLE FILES: 85% 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 2 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs:171` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:103— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:103-120 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:142-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:161` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:122` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) src/Senparc.Weixin.MCP.Server/InvokeWeixinApiHelper.cs:73— src/Senparc.Weixin.MCP.Server/InvokeWeixinApiHelper.cs:73-90 | src/Senparc.Weixin.MCP.Server/InvokeWeixinApiHelper.cs:110-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MCP.Server/InvokeWeixinApiHelper.cs:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:102— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:102-119 | REDACTED:103-120 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the method that made it · ×17
Disposable created and abandoned in the method that made it src/Senparc.Weixin.MP/Senparc.Weixin.MP/CheckSignature.cs:107— `sha1` is a `SHA1`, which implements `IDisposable`, and it is created here (line 107). Every use of it in `GetSignature` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sha1 = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:132— `aes` is a `RijndaelManaged`, which implements `IDisposable`, and it is created here (line 132). Every use of it in `AES_Decrypt` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var aes = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:184— `cs` is a `CryptoStream`, which implements `IDisposable`, and it is created here (line 184). Every use of it in `AES_Decrypt` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cs = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/DocumentController.cs:139— `fs` is a `FileStream`, which implements `IDisposable`, and it is created here (line 139). Every use of it in `Download` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fs = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:102— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 102). Every use of it in `Index` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:264— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 264). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:266— `fileStream` is a `MemoryStream`, which implements `IDisposable`, and it is created here (line 266). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fileStream = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:910— `streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 910). Every use of it in `SendGroupRedPack` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:958— `streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 958). Every use of it in `GetHBInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1022— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 1022). Every use of it in `ProductPayCode` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:27— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 27). Every use of it in `GerQrCodeStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:345— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 345). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:347— `fileStream` is a `MemoryStream`, which implements `IDisposable`, and it is created here (line 347). Every use of it in `Native` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var fileStream = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:914— `streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 914). Every use of it in `SendGroupRedPack` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:962— `streamReader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 962). Every use of it in `GetHBInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var streamReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it REDACTED:1026— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 1026). Every use of it in `ProductPayCode` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:27— `bitmap` is a `Bitmap`, which implements `IDisposable`, and it is created here (line 27). Every use of it in `GerQrCodeStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bitmap = …;`), which releases it at the end of the scope on every path including a throw.
Duplicated block (11 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1058— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1058-1068 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1098-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1058` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:195— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:195-205 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs:130-140 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:195` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3687— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3687-3697 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3768-3778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3687` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Order/OrderApi.cs:90— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Order/OrderApi.cs:90-100 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Order/OrderApi.cs:187-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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Order/OrderApi.cs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:403— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:403-413 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:394-404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `NonTaxDownloadBillRequest` in one and `DeliveryProviderGetBillRequest` 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 (11 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:419— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:419-429 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:410-420 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `NonTaxDownloadBillRequest` in one and `DeliveryProviderGetBillRequest` 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 (11 lines × 2) REDACTED:57— REDACTED:57-67 | REDACTED:100-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 `REDACTED:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:839— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:839-849 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/TenPayHttpClient.cs:307-317 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayNotifyHandler.cs:269— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayNotifyHandler.cs:269-279 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayNotifyHandler.cs:301-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:180— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:180-190 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/UnfreezeProfitsharingReturnJson.cs:125-135 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/UnfreezeProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:740— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:740-750 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:692-702 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:740` 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, `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:706` calls `FundflowBillQueryRequestData` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:752` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:804— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:804-814 | REDACTED:808-818 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) REDACTED:65— REDACTED:65-75 | REDACTED:57-67 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (11 lines × 2) REDACTED:197— REDACTED:197-207 | REDACTED:189-199 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (11 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:43— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:43-53 | Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs:43-53 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs` and `Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs` as WHOLE FILES: 83% 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) REDACTED:615— REDACTED:615-625 | REDACTED:528-538 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×15
Members sharing a duplicated core (4 members, 50+ identical tokens) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:179— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:179-193 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:206-220 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:232-246 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:287-301 — 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:415— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:415-429 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:442-456 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:468-482 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:523-537 — 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:402— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:402-415 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:418-431 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:393-406 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:409-422 — 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:214— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:214-240 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs:153-179 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/WxCardApiTicketContainer.cs:187-213 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/ComponentContainer.cs:486-517 — 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) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:384— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:384-390 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ImmediateDelivery/ImmediateDeliveryApi.cs:434-441 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressApi.cs:262-269 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressProviderApi.cs:118-125 — 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) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:120— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:120-141 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:191-221 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1023-1053 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1103-1124 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:102— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:102-126 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:139-166 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:162-207 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:233-281 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:893— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:893-903 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:966-976 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1458-1468 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1532-1542 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:69— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:69-81 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:99-112 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:69-81 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:99-112 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:87— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:87-162 | REDACTED:135-203 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/WeixinController.cs:79-152 | REDACTED:75-136 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:134— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:134-153 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:977-996 | REDACTED:981-1000 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:125-144 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:223— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:223-256 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:130-163 | REDACTED:126-159 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:214-247 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:334— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:334-416 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:477-550 | REDACTED:238-312 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:323-387 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:91— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:91-154 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:161-199 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:206-269 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:439-477 — 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:862— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:862-915 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:921-963 | REDACTED:866-919 | REDACTED:925-967 — 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.
Duplicated block (8 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:348— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:348-355 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:365-372 — both copies are in the same file, so extract the 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 `data` to `SendTextCardData` in one and `SendMiniNoticeData` 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 × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeChatCustomerService/WeChatCustomerServiceJson.cs:214— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeChatCustomerService/WeChatCustomerServiceJson.cs:214-221 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/WeChatCustomerService/WeChatCustomerServiceJson.cs:315-322 — both copies are in the same file, so extract the 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:402— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:402-409 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:418-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:393— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:393-400 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:409-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:393` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:313— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:313-320 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1086-1093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:450— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:450-457 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1217-1224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:764— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:764-771 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1337-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:764` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:800— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:800-807 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1371-1378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:800` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:839— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:839-846 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1404-1411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:874— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:874-881 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1439-1446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:874` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:172— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:172-179 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/RequestData/EcommerceSubMerchantRequestData.cs:213-261 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:172` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:309— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:309-316 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs:248-255 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:135— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:135-143 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:184-191 — both copies are in the same file, so extract the 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) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:353— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:353-360 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:103-110 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:353` 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) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:634— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:634-641 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:282-289 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:634` 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.
Swallowed exception (caught, then discarded) REDACTED:98— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:133— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:153— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:196— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:228— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:268— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:365— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:112— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:131— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:158— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:206— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/TenPayV3Results.cs:189— `catch (System.Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:59— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:140— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Samples/All/Senparc.Weixin.Sample.CommonService/TemplateMessage/WeixinTemplate_ExceptionAlert.cs:84— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (21 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:171— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:171-191 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:740-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:217— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:217-237 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:786-806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (21 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:314— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:314-334 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:883-903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs:133— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs:133-153 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:116-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:52— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:52-72 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:72-92 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Enums.cs:588— src/Senparc.Weixin/Senparc.Weixin/Enums.cs:588-608 | src/Senparc.Weixin/Senparc.Weixin/Enums.cs:798-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs:69— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs:69-89 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs:106-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:122— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:122-142 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs:117-137 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:241— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:241-261 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs:202-222 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:192— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:192-212 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1024-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:192` 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 (21 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:477— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:477-497 | REDACTED:238-258 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:477` 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 (21 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:562— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:562-582 | REDACTED:567-587 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/Async/CustomMessageHandlerAsync_Events.cs:95— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/Async/CustomMessageHandlerAsync_Events.cs:95-115 | Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler_Events.cs:484-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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/Async/CustomMessageHandlerAsync_Events.cs:95` 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 (21 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:56— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:56-76 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:49-69 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 (13 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:513— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:513-525 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:564-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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:513` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:628— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:628-640 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:655-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:628` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.cs:68— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.cs:68-80 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs:287-299 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3PayBankRequestData.cs:130— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3PayBankRequestData.cs:130-142 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3QueryBankRequestData.cs:79-91 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3PayBankRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3QueryBankRequestData.cs` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3PayBankRequestData.cs:129` calls `Parse` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/PayBank/TenPayV3QueryBankRequestData.cs:78` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:573— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:573-585 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:698-710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:573` 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 `receiver` to `TenpayV3ProfitShareingAddReceiverRequestData_ReceiverInfo` in one and `TenpayV3ProfitShareing_ReceiverInfo` 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:696` calls `SetParameterWhenNotNull` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:568` 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 (13 lines × 2) src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs:107— src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs:107-119 | src/Senparc.Weixin.WxOpen.Middleware/MessageHandlers/Middleware/WxOpenMessageHandlerMiddleware.cs:108-120 — before extracting anything, compare `src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs` and `src/Senparc.Weixin.WxOpen.Middleware/MessageHandlers/Middleware/WxOpenMessageHandlerMiddleware.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:590— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:590-602 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:635-647 — both copies are in the same file, so extract the 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 `data` to `RefundRequsetData` in one and `RefundRequestData` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:234— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:234-246 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs:193-205 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/MarketingApis.Favor.cs:330— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/MarketingApis.Favor.cs:330-342 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/MarketingApis.Favor.cs:382-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/MarketingApis.Favor.cs:330` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:650— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:650-662 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:668-680 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 198 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `amount` to `long` in one and `int` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:69— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:69-81 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:69-81 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) REDACTED:319— REDACTED:319-331 | REDACTED:251-264 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:143— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:143-155 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:174-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:143` 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) REDACTED:121— REDACTED:121-133 | REDACTED:107-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:121` 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.
MethodTooLong: WorkMessageHandler.OnEventRequestAsync src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:198— MethodTooLong — OnEventRequestAsync runs 329 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× 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: DefaultWorkMessageContext.GetRequestEntityMappingResult src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:76— MethodTooLong — GetRequestEntityMappingResult runs 241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× 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: WeixinDevSidebarProvider._getHtmlForWebview tools/WeixinDev/src/sidebarProvider.ts:89— MethodTooLong — _getHtmlForWebview runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× 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: DefaultMpMessageContext.GetRequestEntityMappingResult src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs:58— MethodTooLong — GetRequestEntityMappingResult runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MessageHandler.OnEventRequestAsync src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs:50— MethodTooLong — OnEventRequestAsync runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MessageHandler.OnEventRequest src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs:52— MethodTooLong — OnEventRequest runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EntityHelper.FillEntityWithXml src/Senparc.Weixin.Work/Senparc.Weixin.Work/Helpers/EntityHelper.cs:96— MethodTooLong — FillEntityWithXml runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: TenPayApiRequest.RequestMultipartCoreAsync src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:370— MethodTooLong — RequestMultipartCoreAsync runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DefaultWxOpenMessageContext.GetRequestEntityMappingResult src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs:39— MethodTooLong — GetRequestEntityMappingResult runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: CommonApi.GetMenuFromJsonResult src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:223— MethodTooLong — GetMenuFromJsonResult runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WxOpenMessageHandler.OnEventRequest src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:81— MethodTooLong — OnEventRequest runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.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: WxOpenMessageHandler.OnEventRequestAsync src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:499— MethodTooLong — OnEventRequestAsync runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.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: RequestMessageFactory.GetRequestEntity src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs:59— MethodTooLong — GetRequestEntity runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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.
Test cannot fail: GetConversationRecordsTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:41— This test's act runs inside `catch (Exception)` at line 62 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: GetConversationRecordsAsyncTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:69— This test's act runs inside `catch (Exception)` at line 84 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: GetConversationRecordsWithRequestObjectTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:90— This test's act runs inside `catch (Exception)` at line 110 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: LimitValidationTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:116— This test's act runs inside `catch (Exception)` at line 132 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: GetMessageStatisticsTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:138— This test's act runs inside `catch (Exception)` at line 152 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: GetMessageStatisticsAsyncTest src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/DataIntelligence/DataIntelligenceTest.cs:158— This test's act runs inside `catch (Exception)` at line 178 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: ConcurrentTesting src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/AsyncTest.cs:62— This test's act runs inside `catch (Exception)` at line 103 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. Adding an assertion inside that region does not fix it: the assertion throws, and the same catch swallows it exactly like the exception it replaced. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: TestMaxLegth src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/Custom/CustomTest.cs:123— This test's act runs inside `catch (Exception)` at line 138 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 1 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: GetUserInfoTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CommonAPIs/CommonApiTest.cs:265— This test's act runs inside `catch (Exception)` at line 274 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 1 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: ContainerTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/Containers/AccessTokenContainerTest.cs:45— This test's act runs inside `RunMutipleCache` at src/Senparc.Weixin/Senparc.WeixinTests/MutipleCacheTestWapper.cs:65, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 7 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: NonPostRequestDoesNotReadBodyTest src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/HttpHandlers/TenPayNotifyHandlerTests.cs:189— This test's act runs inside `catch (Exception)` at line 215 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 1 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Test cannot fail: SendThrowTest src/Senparc.Weixin/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs:9— This test's act runs inside `catch (Exception)` at line 22 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 1 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
Hotspot: src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:198— src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs changed 5 times in last 90 days, max cyclomatic complexity 68 in WorkMessageHandler.OnEventRequestAsync at line 198. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:76— src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs changed 4 times in last 90 days, max cyclomatic complexity 74 in DefaultWorkMessageContext.GetRequestEntityMappingResult at line 76. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs:39— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs changed 4 times in last 90 days, max cyclomatic complexity 36 in DefaultWxOpenMessageContext.GetRequestEntityMappingResult at line 39. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageContexts/DefaultWxOpenMessageContext.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:370— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs changed 5 times in last 90 days, max cyclomatic complexity 22 in TenPayApiRequest.RequestMultipartCoreAsync at line 370. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs:81— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs changed 3 times in last 90 days, max cyclomatic complexity 34 in WxOpenMessageHandler.OnEventRequest at line 81. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs:59— src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs changed 3 times in last 90 days, max cyclomatic complexity 30 in RequestMessageFactory.GetRequestEntity at line 59. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:270— REDACTED changed 3 times in last 90 days, max cyclomatic complexity 19 in SecurityHelper.RSAFromXmlString at line 270. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:544— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs changed 2 times in last 90 days, max cyclomatic complexity 25 in RedPackApi.SearchRedPack at line 544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:94— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs changed 2 times in last 90 days, max cyclomatic complexity 24 in RedPackApi.SendNormalRedPackViaProvider at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/OpenHardware/OpenHardwareCallbackHandler.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/OpenHardware/OpenHardwareCallbackHandler.cs:88— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/OpenHardware/OpenHardwareCallbackHandler.cs changed 2 times in last 90 days, max cyclomatic complexity 18 in OpenHardwareCallbackHandler.ParsePlaintext at line 88. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/OpenHardware/OpenHardwareCallbackHandler.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:238— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs changed 2 times in last 90 days, max cyclomatic complexity 18 in MessageHandler.Init at line 238. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:138— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs changed 2 times in last 90 days, max cyclomatic complexity 16 in ShakeRedPackApi.HbPreOrder at line 138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-08..2026-08-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-08 02:03:42 +08:00' --until='2026-08-06 02:03:42 +08:00' --full-history --no-merges -- src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (20 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingRecordCurrentJson.cs:59— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingRecordCurrentJson.cs:59-81 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingRecordCurrentJson.cs:117-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:75— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:75-94 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:95-114 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Enums.cs:547— src/Senparc.Weixin/Senparc.Weixin/Enums.cs:547-566 | src/Senparc.Weixin/Senparc.Weixin/Enums.cs:761-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) REDACTED:198— REDACTED:198-217 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:225-244 — before extracting anything, compare `REDACTED` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3InfoCollection.cs:73— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3InfoCollection.cs:73-92 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3InfoCollection.cs:84-103 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3InfoCollection.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3InfoCollection.cs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3InfoCollection.cs:71` calls `object` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3InfoCollection.cs: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 (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:264— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:264-283 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:306-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:465— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:465-484 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:507-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:795— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:795-814 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:832-851 — both copies are in the same file, so extract the 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:817` calls `SelectSingleNode` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:853` 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 (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:193— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:193-212 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:235-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:143— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:143-162 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:184-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (20 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397-416 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:368-387 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397` 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 (20 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:589— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:589-608 | REDACTED:594-613 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:47— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:47-65 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:142-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs:336— src/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs:336-354 | src/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs:548-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs:336` 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 (19 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Enums.cs:261— src/Senparc.Weixin/Senparc.Weixin/Enums.cs:261-279 | src/Senparc.Weixin/Senparc.Weixin/Enums.cs:655-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1130— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1130-1148 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3297-3315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastRoomJson.cs:77— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastRoomJson.cs:77-95 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastRoomJson.cs:129-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:175— src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:175-193 | src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs:176-194 — before extracting anything, compare `src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs` and `src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy/RedisContainerCacheStrategy.cs` as WHOLE FILES: 98% 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 2 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. 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 (19 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:189— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:189-207 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:263-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:189` 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:260` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:186` 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 (19 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/ReturnJson/Apply4SubCurrentReturnJson.cs:92— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/ReturnJson/Apply4SubCurrentReturnJson.cs:92-110 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/ReturnJson/Apply4SubCurrentReturnJson.cs:122-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:688— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:688-706 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:731-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:688` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:68— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:68-86 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:68-86 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/AccessTokenContainer.cs:397— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Containers/AccessTokenContainer.cs:397-415 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs:212-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:125— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:125-151 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3Util.cs:124-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:196— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:196-205 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:195-204 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/JSSDK/JSSDKHelper.cs:107— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/JSSDK/JSSDKHelper.cs:107-116 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/JSSDK/JSSDKHelper.cs:136-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/JSSDK/JSSDKHelper.cs: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 (10 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1293— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1293-1302 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1323-1332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1293` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:894— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:894-903 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:967-976 — both copies are in the same file, so extract the 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 (10 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1459— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1459-1468 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1533-1542 — both copies are in the same file, so extract the 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 (10 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:402— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:402-411 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:427-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:402` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:449— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:449-458 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:472-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:449` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ChainBrandProfitsharing/ChainBrandProfitsharingApis.cs:362— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ChainBrandProfitsharing/ChainBrandProfitsharingApis.cs:362-372 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Security/SecurityEchoApis.cs:84-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:42— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:42-51 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:35-44 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs: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 (10 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:91— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:91-100 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:84-93 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:57— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:57-66 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:47-56 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:79— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:79-88 | REDACTED:80-89 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1117— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1117-1123 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1133-1139 — both copies are in the same file, so extract the 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 `data` to `SendMiniProgramNoticeData` in one and `SendTaskCardNoticeData` 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 (7 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoiceResultJson.cs:108— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoiceResultJson.cs:108-114 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/RequestMessageEvent_Submit_Invoice_Title.cs:48-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:206— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:206-212 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3TransfersRequestData.cs:174-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3TransfersRequestData.cs:172` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:205` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:431— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:431-437 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1199-1205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:431` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:668— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:668-674 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1271-1277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:668` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:817— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:817-823 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1387-1393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:817` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:855— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:855-861 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1420-1426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:855` 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) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:343— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:343-349 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs:248-254 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs:124— src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs:124-130 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/RequestMessageFactory.cs:117-123 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/RequestMessageFactory.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/RequestMessageFactory.cs` as WHOLE FILES: 90% 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 2 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 (7 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/CombineTransactionsRequestData.cs:194— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/CombineTransactionsRequestData.cs:194-200 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/TransactionsRequestData.cs:617-623 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:769— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:769-775 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:787-793 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 198 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 × 2) REDACTED:148— REDACTED:148-154 | REDACTED:140-146 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:444— src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:444-453 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/OpenAPIs/OpenApi.cs:212-216 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:444` 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) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseApi.cs:852— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseApi.cs:852-856 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBaseBatch/CloudBaseBatchApi.cs:741-745 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Face/FaceApi.cs:114— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Face/FaceApi.cs:114-118 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Soter/SoterApi.cs:67-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Face/FaceApi.cs:122— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Face/FaceApi.cs:122-126 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Soter/SoterApi.cs:75-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastApi.cs:542— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastApi.cs:542-546 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/TransactionGuarantee/TransactionGuaranteeApi.cs:499-505 — 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) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastApi.cs:550— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/LiveBroadcast/LiveBroadcastApi.cs:550-554 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/TransactionGuarantee/TransactionGuaranteeApi.cs:509-515 — 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) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/MiniDrama/MiniDramaApi.cs:265— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/MiniDrama/MiniDramaApi.cs:265-269 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Novel/NovelApi.cs:313-317 — 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 `request` to `MiniDramaMediaIdRequest` in one and `NovelBookIdRequest` 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 × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/MiniDrama/MiniDramaApi.cs:273— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/MiniDrama/MiniDramaApi.cs:273-277 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Novel/NovelApi.cs:321-325 — 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 `request` to `MiniDramaMediaIdRequest` in one and `NovelBookIdRequest` 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 × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:466— src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:466-470 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/OpenAPIs/OpenApi.cs:229-233 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:466` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:237— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:237-241 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:221-225 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:70— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:70-74 | Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs:79-83 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs` and `Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs` as WHOLE FILES: 83% 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:77— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs:77-81 | Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs:86-90 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WorkMessageHandler/WorkCustomMessageHandler.cs` and `Samples/Work/Senparc.Weixin.Sample.Work/MessageHandlers/WorkCustomMessageHandler.cs` as WHOLE FILES: 83% 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/CustomerAcquisition/CustomerAcquisitionApi.cs:270— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/CustomerAcquisition/CustomerAcquisitionApi.cs:270-283 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/CustomerAcquisition/CustomerAcquisitionApi.cs:301-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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/CustomerAcquisition/CustomerAcquisitionApi.cs:270` 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 `param` to `CreateCustomerAcquisitionLinkRequest` in one and `ModifyCustomerAcquisitionLinkRequest` 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 (14 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:49— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:49-62 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:134-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:80— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:80-93 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/UrlScheme/UrlSchemeApi.cs:165-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:147— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3CloseOrderRequestData.cs:147-161 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:251-264 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/TransactionsRequestData.cs:74— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/TransactionsRequestData.cs:74-87 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/TransactionsRequestData.cs:118-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/TransactionsRequestData.cs:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:99— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:99-112 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:99-112 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CancelServiceOrderReturnJson.cs:56— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CancelServiceOrderReturnJson.cs:56-69 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/PayServiceOrderReturnJson.cs:56-69 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CancelServiceOrderReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/PayServiceOrderReturnJson.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:102— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:102-115 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:73-86 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs` as WHOLE FILES: 84% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:682— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:682-695 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:335-348 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:220— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:220-233 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:204-217 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3406— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3406-3417 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3432-3443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3406` 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) src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/AuthorizerContainer.cs:372— src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/AuthorizerContainer.cs:372-383 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/AuthorizerContainer.cs:702-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs:59— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs:59-70 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/SearchApi.cs:59-70 — before extracting anything, compare `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/SearchApi.cs` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:121— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:121-132 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1104-1115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:121` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:413— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:413-424 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:423-434 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs:36— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs:36-47 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/SearchApi.cs:36-47 — before extracting anything, compare `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/GenerateSchemeApi.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/SearchApi.cs` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:713— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:713-724 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:662-673 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:713` 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) REDACTED:113— REDACTED:113-124 | REDACTED:114-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:667— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:667-678 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:320-331 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Picture/PictureApi.cs:56— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Picture/PictureApi.cs:56-64 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Picture/PictureApi.cs:73-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant/Picture/PictureApi.cs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:118— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:118-127 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:151-159 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:325— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:325-333 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:461-469 — both copies are in the same file, so extract the 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:334` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:472` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/QueryPartnershipsRequestData.cs:63— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/QueryPartnershipsRequestData.cs:63-71 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/TerminatePartnershipsRequestData.cs:64-72 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/QueryPartnershipsRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/TerminatePartnershipsRequestData.cs` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) REDACTED:47— REDACTED:47-55 | REDACTED:39-47 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 `REDACTED:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Startup.cs:348— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Startup.cs:348-356 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Startup.cs:370-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Startup.cs:348` 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) REDACTED:596— REDACTED:596-604 | REDACTED:509-517 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:644— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:644-652 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:292-300 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:80— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:80-88 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:73-81 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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.
ClassTooLong: CardApi src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs— ClassTooLong — 1521 significant lines (blank, comment-only and punctuation-only lines excluded), 159 methods. The bar is 400 significant lines; this is 1121 over it, 3.80× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: ShakeAroundApi src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs— ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: MassApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs— ClassTooLong — 485 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, declared across 2 files: Mass/MassApi.cs (30), Mass/MassApi.Statistics.cs (2). The bar is 400 significant lines; this is 85 over it, 1.21× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: GroupMessageApi src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs— ClassTooLong — 468 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 68 over it, 1.17× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: CustomApi src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs— ClassTooLong — 441 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 41 over it, 1.10× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: TenPayApiRequest src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 38 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.
ClassTooLong: MailListApi src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MailList/MailListApi.cs— ClassTooLong — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods, declared across 3 files: MailList/MailListApi.cs (50), MailList/MailListMemberAuthorizationApi.cs (8), MailList/MailListCurrentApi.cs (4). The bar is 400 significant lines; this is 27 over it, 1.07× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: InvoiceApi src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 2 over it, 1.01× the bar. Its members are declarations rather than behaviour over shared data — the type holds no instance state — so there is nothing to group them by and nothing to delegate. To reduce it, split it by area instead: move each cohesive group of declarations onto its own smaller type, so no one type has to be read whole to change one of them.
FileTooLong: Card/CardAPI.cs src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs— FileTooLong — 1534 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1034 over it, 3.07× 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: Senparc.Weixin/Enums.cs src/Senparc.Weixin/Senparc.Weixin/Enums.cs— FileTooLong — 1244 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 744 over it, 2.49× 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: Async/WorkMessageHandler.Async.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs— FileTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 218 over it, 1.44× 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: ShakeAround/ShakeAroundApi.cs src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs— FileTooLong — 699 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 199 over it, 1.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: WxApp/WxAppApi.cs src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs— FileTooLong — 627 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 127 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Universal/TenPayV3.cs src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs— FileTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 56 over it, 1.11× 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: External/ExternalApi.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalApi.cs— FileTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 55 over it, 1.11× 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: ComponentAPIs/ComponentApi.cs src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs— FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 19 over it, 1.04× 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.
Duplicated block (26 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:424— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:424-449 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:991-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:180— src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:180-205 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:136-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:180` 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 (26 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:948— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:948-973 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:1951-1976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:948` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:649— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:649-674 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:1346-1371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:649` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26 lines × 2) src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs:78— src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs:78-103 | src/Senparc.Weixin.WxOpen.Middleware/MessageHandlers/Middleware/WxOpenMessageHandlerMiddleware.cs:79-104 — before extracting anything, compare `src/Senparc.Weixin.MP.Middleware/MessageHandlers/Middleware/MpMessageHandlerMiddleware.cs` and `src/Senparc.Weixin.WxOpen.Middleware/MessageHandlers/Middleware/WxOpenMessageHandlerMiddleware.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 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 (26 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:179— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:179-204 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs:32-57 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (26 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:168— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:168-193 | REDACTED:164-189 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:22— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:22-47 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:22-47 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Chat/ChatApi.cs:145— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Chat/ChatApi.cs:145-166 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Chat/ChatApi.cs:408-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Chat/ChatApi.cs:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:44— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:44-65 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MeetingRoom/MeetingRoomJson.cs:98-119 — both copies are in the same file, so extract the 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 (22 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/School/SchoolJson.cs:266— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/School/SchoolJson.cs:266-287 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/School/SchoolJson.cs:345-366 — both copies are in the same file, so extract the 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 (22 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:211— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:211-232 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:461-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:530— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:530-551 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1403-1424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs: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 (22 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:72— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:72-93 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:198-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (22 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:828— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:828-849 | REDACTED:832-853 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:55— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:55-76 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:55-76 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:180— src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:180-194 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs:150-164 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:370— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:370-384 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs:275-289 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:783— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:783-797 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:833-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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:783` 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 `TradeBillQueryRequestData` in one and `FundflowBillQueryRequestData` 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 (15 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs:63— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs:63-77 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs:63-77 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:221— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:221-235 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3Util.cs:207-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:312— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:312-326 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:301-315 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:312` 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) REDACTED:83— REDACTED:83-97 | REDACTED:75-89 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 `REDACTED:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) REDACTED:305— REDACTED:305-319 | REDACTED:276-290 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (41 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingJson.cs:255— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingJson.cs:255-295 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingJson.cs:347-387 — both copies are in the same file, so extract the 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 (41 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:188— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:188-228 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:249-289 — both copies are in the same file, so extract the 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 (41 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:319— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:319-359 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:854-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:319` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (41 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudRun/CloudRunJsonResults.cs:418— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudRun/CloudRunJsonResults.cs:418-458 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudRun/CloudRunJsonResults.cs:639-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (41 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/WxaJson/GetAppealRecordsJsonResult.cs:60— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/WxaJson/GetAppealRecordsJsonResult.cs:60-100 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/RequestMessageEvent_AppealRecord.cs:58-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (41 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/MiniAppRedPackResult.cs:68— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/MiniAppRedPackResult.cs:68-108 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/NormalRedPackResult.cs:72-112 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/MiniAppRedPackResult.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Result/NormalRedPackResult.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (41 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:616— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:616-656 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:556-596 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:616` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (25 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:96— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:96-120 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:116-140 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiApi.cs:339— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiApi.cs:339-363 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiApi.cs:843-867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiApi.cs:339` 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 (25 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:237— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:237-265 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs:162-186 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Containers/AccessTokenContainer.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/AccessTokenContainer.cs:237` 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 (25 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:902— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:902-926 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1777-1801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:902` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/FundApp/FundAppAuthorizationModels.cs:170— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/FundApp/FundAppAuthorizationModels.cs:170-194 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/FundApp/FundAppAuthorizationNotifyModels.cs:85-109 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/FundApp/FundAppAuthorizationModels.cs:170` 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 (25 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ProductCoupon/ProductCouponModels.cs:32— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ProductCoupon/ProductCouponModels.cs:32-56 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ProductCoupon/ProductCouponModels.cs:842-866 — both copies are in the same file, so extract the 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 (25 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:201— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:201-225 | REDACTED:197-221 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:201` 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 (24 lines × 2) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:201— src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:201-224 | src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:352-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:96— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:96-119 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:431-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomServiceApi.cs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (24 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:72— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:72-95 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:123-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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 (24 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:480— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:480-503 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1355-1378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:480` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubCurrentRequestData.cs:275— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubCurrentRequestData.cs:275-298 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Subject/Entities/RequestData/Apply4SubjectCurrentRequestData.cs:264-287 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubCurrentRequestData.cs:275` 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 (24 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:447— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:447-470 | REDACTED:531-554 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) REDACTED:163— REDACTED:163-186 | REDACTED:155-178 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (27 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:230— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:230-256 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:250-276 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 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 (27 lines × 2) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:239— src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:239-265 | src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:390-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:239` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:162— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:162-189 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:700-726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:162` 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 (27 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:210— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:210-238 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:748-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:210` 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 (27 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:439— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:439-465 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:978-1004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:439` 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 (27 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:412— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:412-438 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:1107-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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) REDACTED:79— REDACTED:79-84 | REDACTED:125-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 `REDACTED:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:30— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:30-35 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:50-55 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:38— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:38-43 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:58-63 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:116— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:116-121 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs:83-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:249— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:249-254 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:255-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:212— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:212-217 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:196-201 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (6 members, 50+ identical tokens) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:218— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:218-226 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:236-245 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:255-264 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:274-283 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:293-302 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:312-321 — 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) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:69— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:69-96 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:156-183 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:319-346 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:406-433 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:71-96 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:122-147 — 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) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:110— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:110-132 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:211-233 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:360-382 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:461-483 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs:59-81 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs:100-122 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3UnifiedorderRequestData.cs:335— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3UnifiedorderRequestData.cs:335-407 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:156-200 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:303-341 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:440-476 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:550-585 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:671-710 — 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:290— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:290-302 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:331-342 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:581-592 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:605-616 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:630-641 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1063-1075 — 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.
Duplicated block (50 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/PayTool/PayToolJson.cs:553— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/PayTool/PayToolJson.cs:553-602 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/PayTool/PayToolJson.cs:631-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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/PayTool/PayToolJson.cs:553` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (50 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:141— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:141-190 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs:80-129 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (50 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs:351— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs:351-401 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:509-558 — 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 (50 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/ParkingStateNotifyJson.cs:96— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/ParkingStateNotifyJson.cs:96-145 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/CreateParkingReturnJson.cs:84-133 — 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 (50 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1086— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1086-1135 | REDACTED:1090-1139 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1086` 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 (31 lines × 2) REDACTED:119— REDACTED:119-149 | REDACTED:98-128 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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 `REDACTED:119` 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 (31 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:178— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:178-211 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/BaseCardDetails.cs:158-188 — 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 (31 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryJson/DeliveryProviderJson.cs:360— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryJson/DeliveryProviderJson.cs:360-390 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressProviderJson.cs:146-176 — 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 (31 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:126— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:126-156 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:123-153 — `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs` 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 6 separate duplicated blocks between them, totalling at least 89 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:126` 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:125` calls `Hashtable` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:121` 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 (31 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:285— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:285-315 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:328-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:285` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (23 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:266— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:266-288 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:835-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:266` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:480— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:480-502 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:1044-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:480` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:348— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:348-370 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:900-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Response/ResponseMessageNews.cs:47— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Response/ResponseMessageNews.cs:47-70 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/ResponseMessageNews.cs:24-46 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Response/ResponseMessageNews.cs:47` 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 (23 lines × 2) REDACTED:571— REDACTED:571-593 | REDACTED:484-506 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:200— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:200-216 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:220-236 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1451— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1451-1467 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3598-3614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1451` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1740— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1740-1756 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3887-3903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1740` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3MicroPayRequestData.cs:150— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3MicroPayRequestData.cs:150-166 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundQueryRequestData.cs:134-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:69— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:69-85 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:71-87 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:69` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:415— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:415-421 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1181-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:415` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:466— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:466-473 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1235-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:466` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:650— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:650-657 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1254-1260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:650` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:780— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:780-787 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1353-1359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:780` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1040— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1040-1047 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1605-1611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1040` 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.
Swallowed exception (empty catch) src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:151— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs:183— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:106— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:582— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:230— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (21 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220-240 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs:159-179 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/WxCardApiTicketContainer.cs:193-213 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220` 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 (21 lines × 3) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseModels.cs:68— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseModels.cs:68-88 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBaseBatch/CloudBaseBatchModels.cs:133-153 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudRun/CloudRunJsonResults.cs:143-177 — 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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBase/CloudBaseModels.cs:68` 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 (21 lines × 3) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:361— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:361-381 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:462-482 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs:101-121 — before extracting anything, compare `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs` and `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Filters/CustomOAuthAttribute.cs:14— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Filters/CustomOAuthAttribute.cs:14-34 | Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Filters/CustomOAuthAttribute.cs:15-35 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Filters/CustomOAuthAttribute.cs:15-35 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Filters/CustomOAuthAttribute.cs` and `Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Filters/CustomOAuthAttribute.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Enums.cs:616— src/Senparc.Weixin/Senparc.Weixin/Enums.cs:616-631 | src/Senparc.Weixin/Senparc.Weixin/Enums.cs:848-863 — both copies are in the same file, so extract the 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:162— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:162-177 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:233-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3RefundRequestData.cs:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:68— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:68-83 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs:126-141 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:69— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:69-84 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:70-85 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:69` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:158— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:158-165 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Subject/Entities/RequestData/Apply4SubjectRequestData.cs:81-88 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/RequestData/EcommerceSubMerchantRequestData.cs:158-206 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Apply4Sub/Entities/RequestData/Apply4SubRequestData.cs:158` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:790— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:790-797 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:840-847 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:923-930 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs:790` 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) REDACTED:128— REDACTED:128-135 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:181-188 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs:34-41 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 `REDACTED:128` 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) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:67— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:67-74 | REDACTED:65-72 | REDACTED:57-64 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:67` 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.
R7 · Dead Code· Stale committed build artefact · ×4
Stale committed build artefact — its source no longer exists tools/WeixinDev/out/extension-backup.js.map— tools/WeixinDev/out/extension-backup.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-backup.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it.
Stale committed build artefact — its source no longer exists tools/WeixinDev/out/extension-complex.js.map— tools/WeixinDev/out/extension-complex.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-complex.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it.
Stale committed build artefact — its source no longer exists tools/WeixinDev/out/extension-minimal.js.map— tools/WeixinDev/out/extension-minimal.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-minimal.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it.
Stale committed build artefact — its source no longer exists tools/WeixinDev/out/extension-simple.js.map— tools/WeixinDev/out/extension-simple.js.map sits in 'tools/WeixinDev/out', which tools/WeixinDev/tsconfig.json declares as this project's outDir, so it is committed compiler output; the map itself records that it was generated from 'tools/WeixinDev/src/extension-simple.ts', and no such file exists in the repository — its emitted file is already gone, only the map was left behind. 4 other map(s) in the same directory resolve to sources that do exist, which is what makes the absence provable rather than a path-resolution gap. Delete the orphaned artefact(s), or stop committing the output directory and let the build produce it.
AC3 · Page structure· Page without a main landmark · ×3
Page without a main landmark tools/WeixinBrowserPlugin/src/demo-url-change-feature.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark tools/WeixinBrowserPlugin/src/popup.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark tools/WeixinBrowserPlugin/src/test.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D10 · Test Quality· Fixed-sleep synchronisation · ×3
Fixed-sleep synchronisation: TestMethod1 src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/AsyncTest.cs:18— This test starts a thread it started and then orders itself against it with `Thread.Sleep(5)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: CreateAsyncTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/QrCode/QrCodeApiTests.cs:43— This test starts a thread it started and then orders itself against it with `Thread.Sleep(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: SendTemplateMessageAsyncTest src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/AdvancedAPIs/Template/TemplateTest.cs:267— This test starts a thread it started and then orders itself against it with `Thread.Sleep(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Duplicated block (46 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OneCode/OneCodeJson.cs:175— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OneCode/OneCodeJson.cs:175-220 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OneCode/OneCodeJson.cs:267-312 — both copies are in the same file, so extract the 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 (46 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/AddOrderJsonResult.cs:9— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/AddOrderJsonResult.cs:9-54 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/ReOrderJsonResult.cs:9-54 — before extracting anything, compare `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/AddOrderJsonResult.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/ReOrderJsonResult.cs` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/JsonResult/AddOrderJsonResult.cs:9` 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 (46 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceAccountFundsReturnJson.cs:141— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceAccountFundsReturnJson.cs:141-186 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceAccountFundsReturnJson.cs:269-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.
Duplicated block (43 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:155— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:155-197 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:175-217 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 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 (43 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:414— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:414-456 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:498-540 — both copies are in the same file, so extract the 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 (43 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:921— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:921-963 | REDACTED:925-967 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (37 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs:124— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs:124-160 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceData.cs:19-55 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceData.cs` as WHOLE FILES: 90% 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 2 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs: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 (37 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:261— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:261-297 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:797-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs: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. 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 (37 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1006— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1006-1042 | REDACTED:1010-1046 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 (35 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Report/PatrolReportJson.cs:245— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Report/PatrolReportJson.cs:245-279 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Report/ResidentReportJson.cs:255-289 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Report/PatrolReportJson.cs:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:83— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:83-117 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3TransfersRequestData.cs:83-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (35 lines × 2) REDACTED:451— REDACTED:451-485 | REDACTED:364-398 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (33 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GroupChat_GetJoinWayResult.cs:49— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GroupChat_GetJoinWayResult.cs:49-81 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GroupChat_UpdateJoinWayRequest.cs:40-72 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GroupChat_GetJoinWayResult.cs:49` 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 (33 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/CancelOrderModel.cs:7— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/CancelOrderModel.cs:7-39 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreCancelOrderModel.cs:7-39 — before extracting anything, compare `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/CancelOrderModel.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreCancelOrderModel.cs` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/CancelOrderModel.cs:7` 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 (33 lines × 2) REDACTED:410— REDACTED:410-442 | REDACTED:323-355 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (32 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:235— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:235-266 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:1239-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (32 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:162— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:162-193 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:153-184 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 (32 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:594— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:594-625 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:242-273 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 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 (30 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:123— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:123-152 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:143-172 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 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 (30 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:900— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:900-929 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:1903-1932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundApi.cs:900` 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 (30 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:110— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:110-139 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:103-132 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22 lines × 4) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70-91 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:157-178 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:320-341 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:407-428 — 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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 4) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:110— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:110-131 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:360-381 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs:59-80 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs:100-121 — before extracting anything, compare `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs` and `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:136— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:136-157 | REDACTED:178-199 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/WeixinController.cs:126-147 | REDACTED:111-132 — 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:134` calls `Log` and `REDACTED:110` 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 (12 lines × 4) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:182— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:182-193 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:209-220 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:235-246 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:290-301 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:182` 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 × 4) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:418— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:418-429 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:445-456 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:471-482 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:526-537 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentApi.cs:418` 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 × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:70— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:70-81 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:101-112 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:70-81 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:101-112 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:101` 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 × 4) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:384— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:384-390 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ImmediateDelivery/ImmediateDeliveryApi.cs:434-441 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressApi.cs:262-269 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressProviderApi.cs:118-125 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `DeliveryProviderUpdateOrderStatusRequest` in one and `ImmediateDeliveryAddOrderRequest` 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 (7 lines × 4) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:374— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs:374-380 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ImmediateDelivery/ImmediateDeliveryApi.cs:423-430 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressApi.cs:251-258 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressProviderApi.cs:107-114 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `DeliveryProviderUpdateOrderStatusRequest` in one and `ImmediateDeliveryAddOrderRequest` 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 (7 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:818— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:818-824 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/ModifyBusifavorStockInformationRequestData.cs:279-285 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:218-224 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs:854-860 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/RedPacketCover/RedPacketCoverApi.cs:66— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/RedPacketCover/RedPacketCoverApi.cs:66-70 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ServiceMarket/ServiceMarketApi.cs:85-89 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Student/StudentApi.cs:66-70 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/TransactionGuarantee/TransactionGuaranteeApi.cs:519-525 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `RedPacketCoverUrlRequest` in one and `ServiceMarketRetrieveRequest` 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 × 4) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/RedPacketCover/RedPacketCoverApi.cs:74— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/RedPacketCover/RedPacketCoverApi.cs:74-78 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ServiceMarket/ServiceMarketApi.cs:93-97 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Student/StudentApi.cs:74-78 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/TransactionGuarantee/TransactionGuaranteeApi.cs:529-535 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `RedPacketCoverUrlRequest` in one and `ServiceMarketRetrieveRequest` 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 × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397-401 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:525-529 | REDACTED:288-292 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:368-372 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:397` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs:89— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundRequestHandler.cs:59— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/ContainerCacheStrategy/DaprContainerCacheStrategy.cs:117— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/ContainerCacheStrategy/DaprContainerCacheStrategy.cs:117— `GetAll` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs:89— `GetAll` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundRequestHandler.cs:59— `SetParameter` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Fake-async — async method never awaits src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs:558— `OnEvent_ShakearoundUserShakeRequestAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Template/TemplateApi.cs:196— `ListAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Template/TemplateApi.cs:209— `DelAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
X20 · Mistyped argument guard· Argument guard throws the exception its own condition disproves · ×3
Argument guard throws the exception its own condition disproves src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1281— The guard on line 1279 rejects `appKey` and line 1281 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(appKey)` is true of a value that is NOT null: it is satisfied by an EMPTY `appKey`, and on that path `appKey` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition.
Argument guard throws the exception its own condition disproves src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1285— The guard on line 1283 rejects `uri` and line 1285 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(uri)` is true of a value that is NOT null: it is satisfied by an EMPTY `uri`, and on that path `uri` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition.
Argument guard throws the exception its own condition disproves src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs:1316— The guard on line 1314 rejects `sessionKey` and line 1316 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(sessionKey)` is true of a value that is NOT null: it is satisfied by an EMPTY `sessionKey`, and on that path `sessionKey` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition.
BarePragmaDisable src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayJsonSerializer.cs:78— #pragma warning disable IL2026 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayJsonSerializer.cs:79— #pragma warning disable IL3050 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
CommonApi.GetMenuFromJson (cognitive 17) src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:117— CommonApi.GetMenuFromJson has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CommonApi.GetMenuFromJson (cognitive 17) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs:165— CommonApi.GetMenuFromJson has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (12 members, 50+ identical tokens) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:159— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:159-196 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:208-246 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:261-303 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:319-364 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:376-424 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:437-473 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:698-734 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:746-782 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:797-838 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:854-900 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:912-962 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:976-1012 — These 12 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 12 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 12 times.
Members sharing a duplicated core (12 members, 50+ identical tokens) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:264— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:264-326 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427-483 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:486-514 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:168-233 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1057-1143 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1146-1174 | REDACTED:164-229 | REDACTED:1061-1147 | REDACTED:1150-1178 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:255-315 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:398-454 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:457-485 — These 12 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 12 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 12 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:99— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:99-260 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:175-331 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:369-531 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:719-857 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:142-265 — 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.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:69— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:69-87 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:71-91 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:69-88 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:70-90 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:70-90 — 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.
Duplicated block (73 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:437— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:437-509 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:995-1067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:437` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (73 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:99— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:99-171 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MedicalInsurance/MedicalInsuranceModels.cs:219-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (54 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryPermissionByAuthorizationCodeReturnJson.cs:75— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryPermissionByAuthorizationCodeReturnJson.cs:75-128 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryPermissionByOpenidReturnJson.cs:73-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (54 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:862— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:862-915 | REDACTED:866-919 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (53 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:285— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:285-337 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:843-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:285` 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 (53 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:342— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:342-394 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:1038-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (52 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BusinessCircle/Entities/NotifyJson/BusinessCircleNotifyJson.cs:77— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BusinessCircle/Entities/NotifyJson/BusinessCircleNotifyJson.cs:77-128 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BusinessCircle/Entities/NotifyJson/BusinessCircleRefundNotifyJson.cs:80-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (52 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:578— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:578-629 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:593-647 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 198 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 (51–52 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CompleteServiceOrderRequestData.cs:86— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CompleteServiceOrderRequestData.cs:86-136 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/ModifyServiceOrderRequestData.cs:72-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (51–52 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:240— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:240-291 | REDACTED:321-371 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 (42 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:118— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:118-159 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:117-158 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (42 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:321— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs:321-362 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs:260-301 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundRequsetData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (39–40 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:521— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:521-559 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:1060-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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:521` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (39–40 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:101— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:101-139 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs:58-97 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 103 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:101` 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 (37–38 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:360— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:360-397 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:929-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (37–38 lines × 2) REDACTED:334— REDACTED:334-371 | REDACTED:267-303 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (29 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateResultJson.cs:168— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateResultJson.cs:168-196 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateResultJson.cs:233-261 — both copies are in the same file, so extract the 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 (29 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentJson/GetPrivacySettingResult.cs:71— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentJson/GetPrivacySettingResult.cs:71-99 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/RequestData/SetPrivacySettingData.cs:35-63 — 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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentJson/GetPrivacySettingResult.cs: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 (28 lines × 2) REDACTED:266— REDACTED:266-293 | REDACTED:156-183 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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 `REDACTED:266` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs:81— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs:81-108 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs:89-116 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayUtil.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Util.cs` as WHOLE FILES: 85% 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 2 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 4) REDACTED:144— REDACTED:144-161 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:152-169 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:251-268 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:277-294 — before extracting anything, compare `REDACTED` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 4) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29-46 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1024-1041 | REDACTED:1028-1045 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:29-46 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:749— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:749-764 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:795-810 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:892-907 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:749` 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 × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:76— src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:76-91 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:136-151 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/ResponseMessageFactory.cs:37-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Senparc.Weixin.MP/Senparc.Weixin.MP/ResponseMessageFactory.cs:92` calls `ResponseMessageMusic` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Entities/Response/WorkResponseMessageBase.cs:152` 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 (14 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:277— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:277-290 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:312-325 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:334-347 — `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs` 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 3 separate duplicated blocks between them, totalling at least 36 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:277` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:74— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:74-87 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:75-88 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:76-89 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
Duplicated block (12 lines × 3) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:160— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:160-171 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:241-252 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:294-305 — 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 `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:160` 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 × 3) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:991— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:991-1002 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1076-1087 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:1167-1178 — 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 `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:991` 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 × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:80— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:80-90 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:77-87 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:78-88 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:79-89 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 123 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. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
Duplicated block (11 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:203— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:203-213 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1100-1110 | REDACTED:199-209 | REDACTED:1104-1114 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:258— src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:258-267 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:205-214 | src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:278-287 — before extracting anything, compare `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs` and `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:35— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:35-44 | Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs:35-44 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Models/VD/HomeVD.cs:35-44 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs` and `Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs` as WHOLE FILES: 97% 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 (7–8 lines × 7) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:416— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:416-422 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:451-458 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:651-658 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:765-772 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:801-808 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:840-847 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:875-882 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7–8 lines × 7) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1182— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1182-1189 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1218-1225 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1255-1261 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1338-1345 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1372-1379 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1405-1412 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1440-1447 — 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. 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 × 5) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78-85 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:161-168 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:190-197 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:261-268 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:287-294 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78` 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 × 5) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:182— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:182-189 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:325-332 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:461-468 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:572-579 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:697-704 — 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `receiver` to `TenpayV3ProfitShareingAddReceiverRequestData_ReceiverInfo` in one and `TenpayV3ProfitShareing_ReceiverInfo` 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, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:696` calls `SetParameterWhenNotNull` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:178` 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 × 6) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:433— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:433-439 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:469-475 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:670-676 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:783-789 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:857-863 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1043-1049 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `dataInfo` to `TenPayV3OrderQueryRequestData` in one and `TenPayV3CloseOrderRequestData` 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 (7 lines × 6) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1201— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1201-1207 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1237-1243 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1273-1279 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1355-1361 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1422-1428 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1607-1613 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `dataInfo` to `TenPayV3OrderQueryRequestData` in one and `TenPayV3CloseOrderRequestData` 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 (40 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:294— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:294-333 | REDACTED:374-413 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:294` 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 (40 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:615— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:615-654 | REDACTED:620-659 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:615` 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.
End-of-life runtime: .NET net6.0 — src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis.Tests/Senparc.Weixin.Cache.CsRedis.Tests.net8.csproj declares .NET net6.0 as this project's target framework, and .NET 6 LTS, support ended 2024-11-12. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2024-11-12 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
End-of-life runtime: .NET netcoreapp3.1 — Samples/All/Senparc.Weixin.Sample.CommonService/Senparc.Weixin.NetCore3Sample.CommonService.csproj declares .NET netcoreapp3.1 as this project's target framework, and .NET Core 3.1 LTS, support ended 2022-12-13. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2022-12-13 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Off the main sequence: Senparc.Weixin.net10(net462) — Senparc.Weixin.net10(net462): abstractness 0.18, instability 0.00, distance 0.82 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: Senparc.Weixin.MP.net10(net462) — Senparc.Weixin.MP.net10(net462): abstractness 0.01, instability 0.20, distance 0.79 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Low cohesion: TenPayHttpClient (LCOM4 6) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/TenPayHttpClient.cs:62— TenPayHttpClient'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: MsgAuditFinanceNativeApi (LCOM4 6) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MsgAudit/MsgAuditFinanceNativeApi.cs:75— MsgAuditFinanceNativeApi'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.
R2 · Cyclomatic Complexity· Complex function s (cyclomatic 18, cognitive 19) · ×2
Complex function s (cyclomatic 18, cognitive 19) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:88— s has cyclomatic complexity 18 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function s (cyclomatic 18, cognitive 19) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:88— s has cyclomatic complexity 18 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function a (cyclomatic 17, cognitive 18) · ×2
Complex function a (cyclomatic 17, cognitive 18) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:36— a has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function a (cyclomatic 17, cognitive 18) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:36— a has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function on (cyclomatic 15, cognitive 14) · ×2
Complex function on (cyclomatic 15, cognitive 14) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:457— on has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function on (cyclomatic 15, cognitive 14) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:457— on has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 11, cognitive 13) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:434— (anonymous) has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 11, cognitive 13) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:434— (anonymous) has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~508 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~508 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~225 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/components/create/createstep.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~225 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/components/create/createstep.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~131 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/stores/projectStores.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~131 LoC) src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/stroes/projectStores.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC3 · Page structure· Heading level jumps from h1 to h3 · ×1
Heading level jumps from h1 to h3 tools/WeixinBrowserPlugin/src/demo-url-change-feature.html:213— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 4 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
DefaultWorkMessageContext.GetRequestEntityMappingResult (cyclomatic 74) src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:76— DefaultWorkMessageContext.GetRequestEntityMappingResult has cyclomatic complexity 74 (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.
WorkMessageHandler.OnEventRequestAsync (cyclomatic 68) src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/Async/WorkMessageHandler.Async.cs:198— WorkMessageHandler.OnEventRequestAsync has cyclomatic complexity 68 (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.
EntityHelper.FillEntityWithXml (cyclomatic 48) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Helpers/EntityHelper.cs:96— EntityHelper.FillEntityWithXml has cyclomatic complexity 48 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CommonApi.GetButtonGroup (cyclomatic 41) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Common.cs:91— CommonApi.GetButtonGroup has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RequestMessageFactory.GetRequestEntity (cyclomatic 30) src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs:59— RequestMessageFactory.GetRequestEntity has cyclomatic complexity 30 (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.
CustomMessageHandler.AIChatAsync (cyclomatic 30) Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:121— CustomMessageHandler.AIChatAsync has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommonApi.GetMenuFromJsonResult (cyclomatic 26) src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:223— CommonApi.GetMenuFromJsonResult 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.
RedPackApi.SearchRedPack (cyclomatic 25) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:544— RedPackApi.SearchRedPack 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.
RedPackApi.SendNormalRedPackViaProvider (cyclomatic 24) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:94— RedPackApi.SendNormalRedPackViaProvider 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.
RequestHandler.CreateMd5Sign (cyclomatic 23) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:199— RequestHandler.CreateMd5Sign has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RedPackApi.SendNormalRedPack (cyclomatic 23) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:170— RedPackApi.SendNormalRedPack 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. This shape REPEATS in the file: one other method here (RedPackApi.SendNGroupRedPack) 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.
RedPackApi.SendNGroupRedPack (cyclomatic 23) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:365— RedPackApi.SendNGroupRedPack 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. This shape REPEATS in the file: one other method here (RedPackApi.SendNormalRedPack) 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.
TenPayApiRequest.RequestMultipartCoreAsync (cyclomatic 22) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:370— TenPayApiRequest.RequestMultipartCoreAsync 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.
ApiHandlerWapperBase.TryCommonApiBase (cyclomatic 21) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:133— ApiHandlerWapperBase.TryCommonApiBase 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.
ApiHandlerWapperBase.TryCommonApiBaseAsync (cyclomatic 21) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:287— ApiHandlerWapperBase.TryCommonApiBaseAsync 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.
RedPackApi.SendMiniAppRedPack (cyclomatic 21) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:714— RedPackApi.SendMiniAppRedPack 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.
extension.activate (cyclomatic 21) tools/WeixinDev/src/extension.ts:4— extension.activate has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 44, 8, 23). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EntityHelper.ConvertEntityToXml (cyclomatic 19) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Helpers/EntityHelper.cs:324— EntityHelper.ConvertEntityToXml 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.
SecurityHelper.RSAFromXmlString (cyclomatic 19) REDACTED:270— SecurityHelper.RSAFromXmlString 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.
MessageHandler.Init (cyclomatic 18) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:238— MessageHandler.Init has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShakeRedPackApi.HbPreOrder (cyclomatic 16) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:138— ShakeRedPackApi.HbPreOrder 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.
D17 · Explicit Debt· Whole file has no live code · ×1
Whole file has no live code — 5 debt markers inside it Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinAsyncController.cs:27— Every line in this file is a comment or blank — it declares no type, member, using or attribute, so nothing in it reaches the build. Its 5 debt markers (5 CommentedOutCode) all sit inside that dead text: one decision to leave the whole file switched off, not 5 independent debts. It records no note anywhere: the file is switched off with nothing in it saying why, so a reader cannot tell whether it is waiting on something or was simply abandoned — which is the harder of the two to bring back. Decide the FILE rather than its lines — restore it, or delete it and let version control hold the history. (Every occurrence still counts toward the score and metrics.)
EntityHelper.FillEntityWithXml (cognitive 67) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Helpers/EntityHelper.cs:96— EntityHelper.FillEntityWithXml has cognitive complexity 67 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RedPackApi.SearchRedPack (cognitive 66) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:544— RedPackApi.SearchRedPack has cognitive complexity 66 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonApi.GetButtonGroup (cognitive 61) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Common.cs:91— CommonApi.GetButtonGroup has cognitive complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedPackApi.SendNormalRedPackViaProvider (cognitive 54) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:94— RedPackApi.SendNormalRedPackViaProvider has cognitive complexity 54 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedPackApi.SendNormalRedPack (cognitive 53) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:170— RedPackApi.SendNormalRedPack has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RedPackApi.SendNGroupRedPack) 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.
RedPackApi.SendNGroupRedPack (cognitive 53) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:365— RedPackApi.SendNGroupRedPack has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RedPackApi.SendNormalRedPack) 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.
CustomMessageHandler.AIChatAsync (cognitive 52) Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:121— CustomMessageHandler.AIChatAsync has cognitive complexity 52 (threshold 15). Of this number, 46 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RedPackApi.SendMiniAppRedPack (cognitive 49) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:714— RedPackApi.SendMiniAppRedPack has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonApi.GetMenuFromJsonResult (cognitive 45) src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:223— CommonApi.GetMenuFromJsonResult has cognitive complexity 45 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenPayApiRequest.RequestMultipartCoreAsync (cognitive 40) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:370— TenPayApiRequest.RequestMultipartCoreAsync has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SecurityHelper.RSAFromXmlString (cognitive 39) REDACTED:270— SecurityHelper.RSAFromXmlString has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShakeRedPackApi.HbPreOrder (cognitive 38) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:138— ShakeRedPackApi.HbPreOrder has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiHandlerWapperBase.TryCommonApiBase (cognitive 34) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:133— ApiHandlerWapperBase.TryCommonApiBase has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiHandlerWapperBase.TryCommonApiBaseAsync (cognitive 33) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:287— ApiHandlerWapperBase.TryCommonApiBaseAsync has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenPayApiRequest.RequestAsyncCore (cognitive 32) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:692— TenPayApiRequest.RequestAsyncCore has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EntityHelper.ConvertEntityToXml (cognitive 27) src/Senparc.Weixin.Work/Senparc.Weixin.Work/Helpers/EntityHelper.cs:324— EntityHelper.ConvertEntityToXml has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extension.activate (cognitive 25) tools/WeixinDev/src/extension.ts:4— extension.activate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 44, 8, 23). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EventService.ConfigOnWeixinExceptionFunc (cognitive 19) Samples/All/Senparc.Weixin.Sample.CommonService/EventService.cs:110— EventService.ConfigOnWeixinExceptionFunc has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestMessageFactory.GetRequestEntity (cognitive 18) src/Senparc.Weixin.Work/Senparc.Weixin.Work/RequestMessageFactory.cs:59— RequestMessageFactory.GetRequestEntity has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
WebSocketHandler.HandleMessage (cognitive 18) src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:22— WebSocketHandler.HandleMessage has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageHandler.Init (cognitive 18) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:238— MessageHandler.Init has cognitive complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestHandler.CreateMd5Sign (cognitive 18) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:199— RequestHandler.CreateMd5Sign has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomMessageHandler.OnTextRequestAsync (cognitive 18) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:125— CustomMessageHandler.OnTextRequestAsync has cognitive complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 461, 207, 267, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CustomWxOpenMessageHandler.OnTextRequestAsync (cognitive 18) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:109— CustomWxOpenMessageHandler.OnTextRequestAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenPayApiResultCode.TryGetCode (cognitive 18) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Entities/TenPayApiResultCode.cs:124— TenPayApiResultCode.TryGetCode has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SimulateToolController.Index (cognitive 16) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/SimulateToolController.cs:344— SimulateToolController.Index has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: DefaultWorkMessageContext.cs ↔ WorkMessageHandler.cs src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs— `src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageHandlers/WorkMessageHandler.cs` change together 57% of the time (13 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `a682db6c` 添加通用模板卡片右上角菜单事件推送; 修复不正确的通用模板卡片事件推送类型;; `0fb36137` 企业微信增加:模板卡片点击回调事件; `43dfc359` 企业微信中间件增加:会话存档-产生会话回调事件回调; — run `git show` on any of them.
Near-duplicate member pair (69 shared lines) src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:140— src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:140-265 | src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper/ApiHandlerWapperBase.cs:294-416 — These two members are variants of one another: 69 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· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:123— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:123-196 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:121-224 — 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· Members sharing a duplicated core (30 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (30 members, 50+ identical tokens) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:313— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:313-321 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:415-422 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:431-440 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:450-458 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:466-476 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:650-658 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:668-677 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:764-772 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:780-790 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:800-808 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:817-830 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:839-847 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:855-864 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:874-882 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1040-1050 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1086-1094 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1181-1189 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1199-1208 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1217-1225 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1235-1244 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1254-1261 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1271-1280 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1337-1345 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1353-1362 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1371-1379 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1387-1395 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1404-1412 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1420-1429 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1439-1447 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1605-1614 — These 30 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 30 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 30 times.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:124— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:124-149 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:170-195 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:216-241 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:265-292 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:313-338 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:359-401 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:423-457 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:683-719 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:739-764 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:785-810 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:834-861 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:882-907 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:928-969 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:990-1021 — These 14 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 14 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 14 times.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (13 members, 50+ identical tokens) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:63— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:63-91 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:151-174 | REDACTED:144-166 | REDACTED:198-217 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:152-174 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:225-244 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:180-203 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:211-229 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:237-263 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:251-272 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:200-258 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:270-299 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:277-298 — These 13 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 13 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 13 times.
Duplicated block (131 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:125— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:125-255 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:2363-2493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:125` 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 (126 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:91— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:91-216 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:91-216 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (115 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:89— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:89-203 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs:151-265 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (107–108 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:92— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:92-199 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:96-202 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (106 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:34— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:34-139 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:362-467 — both copies are in the same file, so extract the 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 (100 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:114— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:114-213 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:670-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageApi.cs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (98 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs:82— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs:82-179 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs:82-179 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (58–96 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingJson.cs:77— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingJson.cs:77-172 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingManagementJson.cs:143-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (94 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:19— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:19-112 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:18-111 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/MakeOutInvoiceData.cs:19` 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 (83 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs:123— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs:123-205 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:251-333 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs:210-292 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateUniqueThresholdActivityRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (30–82 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/OrderReturnJson.cs:46— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/OrderReturnJson.cs:46-127 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MiniProgramPay/MiniProgramPayJson.cs:519-548 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/OrderReturnJson.cs:46` 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 (81 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:429— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:429-509 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:439-519 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (80 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:119— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:119-198 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:119-198 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (74–75 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:93— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:93-166 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:95-169 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (68–73 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:133— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs:133-205 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs:81-148 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivitiesReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryPaygiftActivityReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 169 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (62–72 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:108— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:108-179 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:249-310 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:108` 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 (71 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:204— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:204-274 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/OrderReturnJson.cs:231-301 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/ReturnJson/CombineOrderReturnJson.cs:204` 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 (63–69 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CompleteServiceOrderReturnJson.cs:122— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CompleteServiceOrderReturnJson.cs:122-184 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:130-194 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:132-198 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:139-207 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (67 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/QrCode/QrCodeApi.cs:93— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/QrCode/QrCodeApi.cs:93-159 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/QrCode/QrCodeApi.cs:232-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/QrCode/QrCodeApi.cs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (66 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:195— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:195-260 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/UnfreezeProfitsharingReturnJson.cs:140-205 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/UnfreezeProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (56–64 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:202— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:202-257 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardUpdateData.cs:84-147 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs` and `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardUpdateData.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (63 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/NotifyJson/StockNotifyJson.cs:70— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/NotifyJson/StockNotifyJson.cs:70-132 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryCouponReturnJson.cs:64-126 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryCouponsReturnJson.cs:91-153 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryCouponReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryCouponsReturnJson.cs` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (57–60 lines × 5) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:168— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:168-225 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CreateServiceOrderReturnJson.cs:149-205 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:159-218 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:162-219 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:171-230 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 123 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 (58–60 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/PayBusifavorReceiptsRequestData.cs:76— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/PayBusifavorReceiptsRequestData.cs:76-135 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs:91-148 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs:91-148 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/PayBusifavorReceiptsReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorPayReceiptsReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/PayBusifavorReceiptsRequestData.cs:76` 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 (59 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/PayNotifyJson.cs:250— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/PayNotifyJson.cs:250-308 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/RequestData/PayParkingRequestData.cs:239-297 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:248-306 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:248-306 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25–59 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/NotifyJson/RefundNotifyJson.cs:52— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/NotifyJson/RefundNotifyJson.cs:52-110 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceRefundReturnJson.cs:242-282 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MiniProgramPay/MiniProgramPayJson.cs:785-809 — 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.
Duplicated block (58–59 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:86— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:86-144 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs:89-146 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 114 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 (54–56 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:65— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:65-118 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:353-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs: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. 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 (55 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingWebinarJson.cs:69— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingWebinarJson.cs:69-123 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Meeting/MeetingWebinarJson.cs:173-227 — both copies are in the same file, so extract the 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 (51–55 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Info.cs:56— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/TenPayV3Info.cs:56-110 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayV3Info.cs:72-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (52 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:195— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs:195-246 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryProfitsharingReturnJson.cs:165-216 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/UnfreezeProfitsharingReturnJson.cs:140-191 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryProfitsharingReturnJson.cs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (50 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:484— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/Entities/ReturnJson/EcommerceReturnJson.cs:484-533 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs:141-191 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs:141-191 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (41–50 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryJson/AddOrderModel.cs:85— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryJson/AddOrderModel.cs:85-125 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WeixinExpress/WeixinExpressReturnJson.cs:101-150 — 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 `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryJson/AddOrderModel.cs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (49 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:377— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:377-425 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs:459-507 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs:306-354 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (48 lines × 6) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:159— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs:159-207 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs:162-209 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/CreateServiceOrderReturnJson.cs:142-191 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/ModifyServiceOrderReturnJson.cs:153-202 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/QueryServiceOrderReturnJson.cs:155-205 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/ReturnJson/SyncPayServiceOrderReturnJson.cs:164-215 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/ConfirmServiceOrderNotifyJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/NotifyJson/PayServiceOrderNotifyJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (48 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:214— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs:214-261 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponReturnJson.cs:302-349 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorCouponsReturnJson.cs:384-431 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs:231-278 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/RequestData/CreateBusifavorStockRequestData.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/ReturnJson/QueryBusifavorStockReturnJson.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 114 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 (48 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateDirectCompleteServiceOrderRequestData.cs:110— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateDirectCompleteServiceOrderRequestData.cs:110-157 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateServiceOrderRequestData.cs:108-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (31–47 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GetExternalContactInfoBatchResult.cs:48— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GetExternalContactInfoBatchResult.cs:48-78 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/GetExternalContactResult.cs:138-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/External/ExternalJson/GetExternalContactInfoBatchResult.cs:48` 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 (45–46 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1035— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1035-1079 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:3201-3246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:1035` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (45 lines × 3) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/AddOrderModel.cs:22— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/AddOrderModel.cs:22-66 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs:17-61 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/ReOrderModel.cs:22-66 — before extracting anything, compare `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/AddOrderModel.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (44–45 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:376— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:376-419 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:912-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (37–44 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:419— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:419-462 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/BaseCardDetails.cs:250-286 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate/CardCreateData.cs:419` 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 (37–43 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthUserInfo.cs:24— src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthUserInfo.cs:24-60 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/QRConnect/QRConnectJson/QRConnectUserInfo.cs:24-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 `src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthUserInfo.cs:24` 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 (42–43 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133-175 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:205-246 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133` 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 (31–41 lines × 4) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs:156— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs:156-196 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs:190-224 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceBatchJson.cs:93-123 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceData.cs:59-99 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceData.cs` as WHOLE FILES: 90% 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 2 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 (19–41 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/SimulateToolController.cs:57— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/SimulateToolController.cs:57-97 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs:60-78 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:78-96 — 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Tools/SimulateToolController.cs:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts/DefaultMpMessageContext.cs:79` calls `RequestMessageLink` and `src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs:97` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25–41 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBaseBatch/CloudBaseBatchModels.cs:135— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudBaseBatch/CloudBaseBatchModels.cs:135-159 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/CloudRun/CloudRunJsonResults.cs:147-187 — 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 (33–40 lines × 3) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs:65— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs:65-97 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs:101-133 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/ImmediateDelivery/ImmediateDeliveryJson.cs:149-188 — 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 `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Express/ExpressJson/PreAddOrderModel.cs: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. 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 (24–40 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MedicalAssistant/MedicalAssistantJson.cs:91— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MedicalAssistant/MedicalAssistantJson.cs:91-130 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/CityService/CityServiceJson.cs:230-253 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MedicalAssistant/MedicalAssistantJson.cs:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37–39 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/BaseCardUpdateInfo.cs:171— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/BaseCardUpdateInfo.cs:171-209 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Common/Card_BaseInfo/Card_BaseInfoBase.cs:179-215 — 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 (38 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:550— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:550-587 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:1245-1282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:550` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (36 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MerchantGovernance/MerchantGovernanceModels.cs:139— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/MerchantGovernance/MerchantGovernanceModels.cs:139-174 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/XPayIncrementJson.cs:111-146 — 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 (33–34 lines × 3) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/DataCube/DataCubeJson/GetWeAnalysisAppidDailyVisitTrendResultJson.cs:54— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/DataCube/DataCubeJson/GetWeAnalysisAppidDailyVisitTrendResultJson.cs:54-86 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/DataCube/DataCubeJson/GetWeAnalysisAppidMonthlyVisitTrendResultJson.cs:51-84 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/DataCube/DataCubeJson/GetWeAnalysisAppidWeeklyVisitTrendResultJson.cs:51-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/DataCube/DataCubeJson/GetWeAnalysisAppidDailyVisitTrendResultJson.cs:54` 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 (34 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:450— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:450-483 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:2689-2722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardAPI.cs:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33 lines × 4) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson/ArticleAnalysisItemJson.cs:64— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson/ArticleAnalysisItemJson.cs:64-96 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson/ArticleAnalysisItemJson.cs:137-169 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson/ArticleAnalysisItemJson.cs:206-238 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson/ArticleAnalysisItemJson.cs:257-289 — 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 (27–33 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:153— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:153-180 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:225-251 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:420-452 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:178-204 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs:91— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs:91-123 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs:141-173 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Invoice/InvoiceJson/InvoiceResultJson.cs:21-53 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31–32 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs:57— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs:57-88 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs:27-57 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs` and `src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:109— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:109-139 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:190-220 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BrandMemberCard/BrandMemberCardModels.cs:437-467 — 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 (29–31 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:483— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:483-511 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:731-761 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:483` 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 (29 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:188— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:188-216 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:249-277 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage/CardManageResultJson.cs:372-400 — 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 (26–29 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthUserInfo.cs:55— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthUserInfo.cs:55-83 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthUserInfo.cs:26-51 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/QRConnect/QRConnectJson/QRConnectUserInfo.cs:29-57 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthUserInfo.cs` and `src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthUserInfo.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28–29 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:212— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:212-239 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs:57-85 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Verifier/SHA256WithRSAVerifier.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:212` 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 (23–24 lines × 2) src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:459— src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:459-482 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:1154-1176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/ComponentAPIs/ComponentApi.cs:459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–24 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3UnifiedorderRequestData.cs:361— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3UnifiedorderRequestData.cs:361-378 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:678-701 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21–24 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:88— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs:88-111 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/Signer/SHA256WithRSASigner.cs:14-34 — 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 (22–23 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:525— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:525-546 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:802-824 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/TenPayHttpClient/TenPayHttpClient.cs:199-220 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs:525` 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 (22–23 lines × 2) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Webhook/WebhookApi.cs:82— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Webhook/WebhookApi.cs:82-104 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Webhook/WebhookApi.cs:304-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Webhook/WebhookApi.cs:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–22 lines × 2) src/Senparc.Weixin/Senparc.Weixin/Utilities/HttpUtility/Post.cs:98— src/Senparc.Weixin/Senparc.Weixin/Utilities/HttpUtility/Post.cs:98-119 | src/Senparc.Weixin/Senparc.Weixin/Utilities/HttpUtility/Post.cs:132-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin/Senparc.Weixin/Utilities/HttpUtility/Post.cs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–21 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133-153 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:205-225 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:401-420 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:741-756 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.cs:398` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/RedPackApi.Via.cs:130` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–21 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:170— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:170-187 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:313-330 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenpayV3ProfitShareingRequestData.cs:557-577 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 6) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70-89 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:157-176 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:320-339 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:407-426 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:72-91 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/ModifyDomain/ModifyDomainApi.cs:123-142 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainApi.cs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–18 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:217— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:217-233 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:244-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/RedPackApi/ShakeRedPackApi.cs:244` 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 (17 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:718— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:718-734 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:766-782 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:996-1012 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:718` 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–17 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3GetTransferInfoRequestData.cs:95— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3GetTransferInfoRequestData.cs:95-109 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3PayToWorkerRequestData.cs:188-204 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3ReverseRequestData.cs:111-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3ReverseRequestData.cs:126` calls `SetParameter` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/Entities/Request/TenPayV3GetTransferInfoRequestData.cs:111` 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 (16–17 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:159— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:159-175 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:185-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:159` 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–17 lines × 2) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ChainBrandProfitsharing/ChainBrandProfitsharingApis.cs:376— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/ChainBrandProfitsharing/ChainBrandProfitsharingApis.cs:376-392 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Security/SecurityEchoApis.cs:97-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–15 lines × 6) src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:721— src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:721-734 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:769-782 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:826-838 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:886-900 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:948-962 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:999-1012 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom/CustomApi.cs:721` 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 × 4) src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220— src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220-237 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs:159-176 | src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/WxCardApiTicketContainer.cs:193-210 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/Containers/ComponentContainer.cs:500-514 — 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/JsApiTicketContainer.cs:220` 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–15 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:71— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:71-85 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:155-168 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:184-197 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–15 lines × 2) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:131— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:131-141 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:207-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs:131` 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 × 4) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:136— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:136-149 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:182-195 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:228-241 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:325-338 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:136` 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 × 6) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:137— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:137-149 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:183-195 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:229-241 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:280-292 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:326-338 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:445-457 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:137` 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 × 4) REDACTED:154— REDACTED:154-166 | REDACTED:205-217 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:162-174 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:232-244 — before extracting anything, compare `REDACTED` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11–12 lines × 6) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:708— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:708-719 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:753-764 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:799-810 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:850-861 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:896-907 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:959-969 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/MassApi.cs:708` 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–12 lines × 2) src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:234— src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/CommonApi.cs:234-245 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/OpenAPIs/OpenApi.cs:112-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10–11 lines × 10) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:151— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:151-161 | REDACTED:144-154 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:152-162 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:180-190 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:211-220 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:237-246 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:251-261 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:200-210 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:270-280 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:277-287 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:251— src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:251-261 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/MessageHandlers/ThirdPartyMessageHandler.cs:76-86 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs:212-222 — before extracting anything, compare `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs` and `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 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 `src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:251` 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–10 lines × 6) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:218— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:218-226 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:236-245 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:255-264 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:274-283 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:293-302 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpApi.cs:312-321 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `SendTextData` in one and `SendImageData` 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–10 lines × 6) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:291— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:291-300 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:332-340 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:582-589 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:606-613 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:631-638 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1064-1073 — 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dataInfo` to `TenPayV3GetSignKeyRequestData` in one and `TenPayV3UnifiedorderRequestData` 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 (7–9 lines × 4) src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/GetEffectiveDomainResultJson.cs:49— src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/GetEffectiveDomainResultJson.cs:49-55 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/ModifyDomainDirectlyResultJson.cs:41-49 | src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/ModifyDomainResultJson.cs:41-49 | src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Operation/OperationJson/OperationModels.cs:24-30 — before extracting anything, compare `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/ModifyDomainDirectlyResultJson.cs` and `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/ModifyDomainResultJson.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Domain/DomainJson/GetEffectiveDomainResultJson.cs:49` 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) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78-87 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:161-170 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:261-269 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:287-295 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:78` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 8) src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:22— src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:22-29 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:46-53 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:71-78 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:94-101 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:121-128 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:146-153 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:173-180 | src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:206-213 — 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 `src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Mass/LinkerCorp/LinkerCorpData.cs:22` 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 × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:894— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:894-901 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:967-974 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1459-1466 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1533-1540 — 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 `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:894` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 14) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:432— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:432-437 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:467-473 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:669-674 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:781-787 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:818-823 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:856-861 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1041-1047 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1200-1205 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1236-1241 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1272-1277 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1354-1359 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1388-1393 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1421-1426 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1606-1611 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dataInfo` to `TenPayV3OrderQueryRequestData` in one and `TenPayV3CloseOrderRequestData` 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 (6 lines × 9) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1087— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1087-1093 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1182-1188 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1218-1224 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1255-1260 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1338-1344 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1372-1378 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1389-1394 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1405-1411 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1440-1446 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1389` calls `ParseXML` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:1087` 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 × 8) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:314— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:314-320 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:416-421 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:451-457 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:651-657 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:765-771 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:801-807 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:840-846 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/Universal/TenPayV3.cs:875-881 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 7) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:193— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs:193-203 | REDACTED:127-137 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs:135-145 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs:133-143 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ResponseHandler.cs:234-244 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/RequestHandler.cs:165-175 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V3/ResponseHandler.cs:260-270 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RequestHandler.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CompleteServiceOrderRequestData.cs:294— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CompleteServiceOrderRequestData.cs:294-299 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateDirectCompleteServiceOrderRequestData.cs:297-302 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/PayScore/Entities/RequestData/CreateServiceOrderRequestData.cs:300-305 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 4) src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/PayNotifyJson.cs:236— src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/NotifyJson/PayNotifyJson.cs:236-245 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/RequestData/PayParkingRequestData.cs:208-217 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs:234-243 | src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs:234-243 — before extracting anything, compare `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/PayParkingReturnJson.cs` and `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/ReturnJson/QueryParkingReturnJson.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 307 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) REDACTED:173— REDACTED:173-195 | REDACTED:33-59 — 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· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:22— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:22-47 | REDACTED:54-158 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:240-291 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:372-439 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1006-1042 | REDACTED:321-371 | REDACTED:452-519 | REDACTED:1010-1046 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:22-47 — 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.
Duplicated block (79 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:714— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:714-792 | REDACTED:718-796 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:714` 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 (74 lines × 2) REDACTED:493— REDACTED:493-566 | REDACTED:406-479 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (69 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/LocationService.cs:24— Samples/All/Senparc.Weixin.Sample.CommonService/LocationService.cs:24-92 | Samples/MP/Senparc.Weixin.Sample.MP/Services/LocationService.cs:24-92 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/LocationService.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/Services/LocationService.cs` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (68 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:372— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:372-439 | REDACTED:452-519 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 (64 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:146— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:146-209 | Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs:130-193 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs` and `Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/MessageHandlers/CustomWxOpenMessageHandler.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 169 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WxOpenMessageHandler/CustomWxOpenMessageHandler.cs:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (58–60 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:87— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:87-146 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/WeixinController.cs:79-136 — 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/WeixinController.cs:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (57 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427-483 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:398-454 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 (56 lines × 2) REDACTED:219— REDACTED:219-274 | REDACTED:211-266 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 `REDACTED:219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (44 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:162— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:162-205 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs:111-154 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 103 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:162` 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 (38–39 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:264— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:264-302 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:255-292 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (31–37 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514-550 | REDACTED:282-312 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514` 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 (34 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:223— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:223-256 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:130-163 | REDACTED:126-159 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:214-247 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–32 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:523— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:523-554 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:174-203 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28–29 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:887— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:887-915 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:936-963 | REDACTED:891-919 | REDACTED:940-967 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:887` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (27 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:486— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:486-512 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1146-1172 | REDACTED:1150-1176 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:457-483 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:486` 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 (24–26 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:578— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:578-601 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:517-542 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 426 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:578` 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–24 lines × 2) REDACTED:173— REDACTED:173-188 | REDACTED:33-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
Duplicated block (23 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427-449 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1057-1079 | REDACTED:1061-1083 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:398-420 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:427` 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 (21–22 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:180— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:180-201 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1068-1088 | REDACTED:176-197 | REDACTED:1072-1092 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 (20–22 lines × 2) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:102— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:102-121 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:214-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:211` calls `ToString`, `BuildRandomStr` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:99` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21–22 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:566— Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:566-587 | Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs:215-235 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/MessageHandlers/CustomMessageHandler.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 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 `Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/CustomMessageHandler/CustomMessageHandler.cs:566` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:134— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:134-153 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:977-996 | REDACTED:981-1000 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:125-144 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–20 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:99— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:99-116 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:164-181 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:211-230 — 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, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:211` calls `ToString`, `BuildRandomStr` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:99` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–19 lines × 6) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:440— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:440-456 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:182-200 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1070-1086 | REDACTED:178-196 | REDACTED:1074-1090 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:411-427 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 4) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:213— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:213-231 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1123-1141 | REDACTED:209-227 | REDACTED:1127-1145 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:213` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:109— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:109-126 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/Open/OpenOAuthController.cs:128-146 | Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs:66-84 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs` and `Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 103 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/OAuth2Controller.cs:109` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–18 lines × 8) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:276— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:276-293 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:438-452 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:180-196 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1068-1082 | REDACTED:176-192 | REDACTED:1072-1086 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:267-284 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:409-423 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:452` calls `GetTimestamp`, `GetNoncestr` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:293` 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–18 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514-529 | REDACTED:282-292 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:355-372 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` and `REDACTED` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 1014 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:514` 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 (17 lines × 8) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:498— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:498-514 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:217-233 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1127-1143 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1158-1174 | REDACTED:213-229 | REDACTED:1131-1147 | REDACTED:1162-1178 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs:469-485 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 163 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:498` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1126` calls `SetString`, `ToString` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs:498` 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 (15–16 lines × 2) REDACTED:329— REDACTED:329-343 | REDACTED:300-315 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 357 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 (15 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:97— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:97-111 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:162-176 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayController.cs:443-457 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–14 lines × 2) Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:471— Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:471-484 | Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:577-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 6) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:23— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:23-33 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:260-272 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1018-1028 | REDACTED:341-353 | REDACTED:1022-1032 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:23-33 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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 `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:23` 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) Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:352— Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:352-364 | Samples/All/Senparc.Weixin.Sample.CommonService/AI/MessageHandlers/CustomMessageHandler_AI.cs:534-545 — both copies are in the same file, so extract the 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–12 lines × 8) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29-40 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:268-278 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:424-434 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1024-1035 | REDACTED:349-359 | REDACTED:504-514 | REDACTED:1028-1039 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:29-40 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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. 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, `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:40` calls `Flush` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:278` 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 (10–11 lines × 9) Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29— Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:29-38 | REDACTED:104-114 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:268-277 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:424-433 | Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:1024-1033 | REDACTED:349-358 | REDACTED:504-513 | REDACTED:1028-1037 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Utilities/QrCodeHelper.cs:29-38 — before extracting anything, compare `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Samples/All/Senparc.Weixin.Sample.CommonService/Utilities/QrCodeHelper.cs:40` calls `Flush` and `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:278` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:20— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:20-28 | Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs:20-28 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Models/VD/HomeVD.cs:20-28 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs` and `Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs` as WHOLE FILES: 97% 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 `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:46— Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs:46-52 | Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs:46-52 | Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Models/VD/HomeVD.cs:46-52 — before extracting anything, compare `Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Models/VD/HomeVD.cs` and `Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models/VD/HomeVD.cs` as WHOLE FILES: 97% 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.
Low coverage: src/Senparc.Weixin.MCP.Server/Tools/RandomNumberTools.cs src/Senparc.Weixin.MCP.Server/Tools/RandomNumberTools.cs— 0.0% line coverage (0/13).
D8 · Code Coverage· No test project references Senparc.Weixin.MP.src · ×1
No test project references Senparc.Weixin.MP.src src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.src.csproj— No test project in this repository references Senparc.Weixin.MP.src (393 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.WxOpen.Packages · ×1
No test project references Senparc.Weixin.WxOpen.Packages src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.Packages.csproj— No test project in this repository references Senparc.Weixin.WxOpen.Packages (312 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.TenPay · ×1
No test project references Senparc.Weixin.TenPay src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.csproj— No test project in this repository references Senparc.Weixin.TenPay (63 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.WebSocket.packages · ×1
No test project references Senparc.WebSocket.packages src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.packages.csproj— No test project in this repository references Senparc.WebSocket.packages (12 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.Cache.Redis.src · ×1
No test project references Senparc.Weixin.Cache.Redis.src src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.src.csproj— No test project in this repository references Senparc.Weixin.Cache.Redis.src (7 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.CLI · ×1
No test project references Senparc.Weixin.CLI tools/Senparc.Weixin.CLI/Senparc.Weixin.CLI.csproj— No test project in this repository references Senparc.Weixin.CLI (6 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.Cache.Memcached · ×1
No test project references Senparc.Weixin.Cache.Memcached src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.csproj— No test project in this repository references Senparc.Weixin.Cache.Memcached (4 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.Cache.Memcached.src · ×1
No test project references Senparc.Weixin.Cache.Memcached.src src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.src.csproj— No test project in this repository references Senparc.Weixin.Cache.Memcached.src (4 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
D8 · Code Coverage· No test project references Senparc.Weixin.Benchmarks · ×1
No test project references Senparc.Weixin.Benchmarks benchmarks/Senparc.Weixin.Benchmarks/Senparc.Weixin.Benchmarks.csproj— No test project in this repository references Senparc.Weixin.Benchmarks (1 production source file(s)), so `dotnet test` never loads it and no coverage tool can measure it — its code is absent from the 77.2% above rather than counted at zero. This is the whole assembly, not a gap within one: add a test project that references it (or a ProjectReference from an existing suite) and its coverage starts being measured.
Outbound HTTP without resilience — Outbound HTTP calls were found with no timeout or retry policy around them. This codebase ships libraries/tools rather than a service it operates, so the failure lands differently: an unbounded call hangs the caller's process — a build step, a CLI run, a UI thread — with no way out.
Sync-over-async blocking — 22 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Awaits without ConfigureAwait(false) — Only 2023/2942 awaits use ConfigureAwait(false). A library that captures the caller's context can stall or deadlock its host — the classic way a dependency drags an app down.
Forked directory tree (36 identical files, ~9924 lines × 2 trees) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/signalr.test.js:1— Samples/WxOpen/Senparc.Weixin.WxOpen.AppDemo/ and src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/ are near-verbatim copies of each other: 36 files are byte-identical under the same relative paths (~9924 lines; the trees hold 43 and 70 files). That is one structural fact, not 36 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place.
Wholesale file copy (392 identical lines × 2 files) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:2— src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/weapp/appservice/asdebug.js:2 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/weapp/appservice/asdebug.js:2 — these 2 files are line-for-line copies of one another — 392 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (201 identical lines × 2 files) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/components/create/createstep.js:3— src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/components/create/createstep.js:3 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/components/create/createstep.js:3 — these 2 files are line-for-line copies of one another — 201 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (101 identical lines × 2 files) src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/stores/projectStores.js:3— src/Senparc.Weixin.WxOpen/小程序资料/crack/mac/Resources/app.nw/app/dist/stores/projectStores.js:3 · src/Senparc.Weixin.WxOpen/小程序资料/crack/win/package.nw/app/dist/stroes/projectStores.js:3 — these 2 files are line-for-line copies of one another — 101 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (44 matched lines × 2 locations) · ×1
Duplicated block with local edits (44 matched lines × 2 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket/websocket.js:3— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket/websocket.js:3 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/websocket_signalr/websocket_signalr.js:4 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (29 lines × 3 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/login-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:7 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (28 lines × 2 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.1.0.js:4— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.1.0.js:4 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.2.0.js:4 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (26 lines × 2 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:136— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:136 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:172 — both copies are in the same file, so extract the 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 (15 lines × 4 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/login-status-card/index.js:6 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/message-list-card/index.js:8 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:7 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/Login/Login.js:20— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/Login/Login.js:20 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/pages/index/index.js:389 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (10 lines × 2 locations) tools/WeixinDev/src/interfaceInserter.ts:33— tools/WeixinDev/src/interfaceInserter.ts:33 · tools/WeixinDev/src/sidebarProvider.ts:60 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:41— src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/connection-status-card/index.js:41 · src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/skills/senparc-login-ws/components/send-result-card/index.js:34 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Complex function (anonymous) (cyclomatic 15, cognitive 19) tools/WeixinDev/src/extension.ts:44— (anonymous) has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~411 LoC) tools/WeixinDev/src/sidebarProvider.ts— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~260 LoC) tools/WeixinDev/src/apiService.ts— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (tools/WeixinDev/src/interfaceInserter.ts, tools/WeixinDev/src/sidebarProvider.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~223 LoC) tools/WeixinDev/src/interfaceInserter.ts— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (tools/WeixinDev/src/sidebarProvider.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~42 LoC) tools/WeixinDev/diagnose.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~38 LoC) src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/utils/senparc.websocket.1.0.js— no import path from any entry point (14 application, 1 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code· Contributed command 'weixindev.openSidebar' is never registered · ×1
Contributed command 'weixindev.openSidebar' is never registered tools/WeixinDev/package.json— tools/WeixinDev/package.json contributes this command, so VS Code offers it in the palette and in every menu or keybinding that cites it — but no source file calls registerCommand with this id, and the id occurs in no source string at all; invoking it fails with "command 'weixindev.openSidebar' not found". The source does register 1 command(s) by literal ('weixindev.insertWeixinInterface'), which is what makes the absence provable. Register it at activation, or delete the contribution together with the menu and keybinding entries that reference it.
R7 · Dead Code· Contributed command 'weixindev.refreshWebview' is never registered · ×1
Contributed command 'weixindev.refreshWebview' is never registered tools/WeixinDev/package.json— tools/WeixinDev/package.json contributes this command, so VS Code offers it in the palette and in every menu or keybinding that cites it — but no source file calls registerCommand with this id, and the id occurs in no source string at all; invoking it fails with "command 'weixindev.refreshWebview' not found". The source does register 1 command(s) by literal ('weixindev.insertWeixinInterface'), which is what makes the absence provable. Register it at activation, or delete the contribution together with the menu and keybinding entries that reference it.
Unused dependency 'sharp' — Declared in tools/WeixinBrowserPlugin/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Weak hash algorithm REDACTED:353— MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. This repository constructs a collision-broken hash (MD5/SHA1) at 7 sites, not one: `src/Senparc.Weixin.MP/Senparc.Weixin.MP/CheckSignature.cs:107` (SHA1), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:133` (MD5), `src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPayDownloadHelper.cs:135` (SHA1), `REDACTED:353` (SHA1CryptoServiceProvider), `REDACTED:355` (SHA1), `REDACTED:285` (SHA1CryptoServiceProvider), `REDACTED:287` (SHA1). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Weak cipher src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:126— DES / 3DES / RijndaelManaged-bare is deprecated or broken. Use AES-GCM via `Aes.Create()` with explicit key/iv sizes. This repository constructs a broken or deprecated cipher at 7 sites, not one: `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:126` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:158` (RijndaelManaged), `src/Senparc.Weixin.Work/Senparc.Weixin.Work/Tencent/Cryptography.cs:233` (RijndaelManaged), `src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Helpers/EncryptHelper.cs:132` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:146` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:178` (RijndaelManaged), `src/Senparc.Weixin/Senparc.Weixin/Tencent/Cryptography.cs:253` (RijndaelManaged). Each is a separate decision — fixing only the line this row cites leaves the others in place.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Helpers/WebSocketHelper.cs:84— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:44— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:45— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:46— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:75— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:119— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:120— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:121— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Common.cs:122— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_Core.cs:31— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_NET45.cs:48— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler/WebSocketHandler_NET45.cs:49— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.All/WeixinEntensions.cs:103— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/RegisterServices/SenparcWeixinRegisterServiceExtension.cs:78— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/RegisterServices/SenparcWeixinRegisterServiceExtension.cs:207— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:40— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:56— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:65— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:71— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:76— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:101— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:134— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/FixWeixinBugWeixinResult.cs:149— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/WeixinResult.cs:72— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code src/Senparc.Weixin.AspNet/Results/WeixinResult.cs:121— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Duplicated predicate src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs:435— `!string.IsNullOrWhiteSpace(responseText) && responseText.TrimStart().StartsWith("{")` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay/NonTaxPayApi.cs, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/Delivery/DeliveryProviderApi.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:246— `_postModel != null && !_postModel.Token.IsNullOrWhiteSpace() && postDataDocument.Root.Element("Encrypt") != null && !string.IsNullOrEmpty(po…` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:141— `fullButton.ContainsKey("key") && !string.IsNullOrEmpty(fullButton["key"] as string)` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs, src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:158— `fullResult != null && fullResult.ContainsKey("errmsg")` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs, src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:132— `fullResult != null && fullResult.ContainsKey("menu")` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Custom.cs, src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Filters/CustomOAuthAttribute.cs:30— `httpContext != null && httpContext.Session.GetString("OpenId") != null` appears character-identically in 3 files — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Filters/CustomOAuthAttribute.cs, Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Filters/CustomOAuthAttribute.cs, Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Filters/CustomOAuthAttribute.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs:77— `null != v && "".CompareTo(v) != 0 && "sign".CompareTo(k) != 0 && "key".CompareTo(k) != 0` appears character-identically in 7 files — src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/CheckRequestHandler.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/ClientRequestHandler.cs, REDACTED, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/RefundResponseHandler.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs:266— `postDataDocument.Root.Element("FromUserName") != null && !string.IsNullOrEmpty(postDataDocument.Root.Element("FromUserName").Value)` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.cs, src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs:489— `resHandler.IsTenpaySign() && return_code.ToUpper() == "SUCCESS"` appears character-identically in 2 files — Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/TenPay/TenPayV3Controller.cs, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:240— `rootButton.type == null || (rootButton.type.Equals("CLICK", StringComparison.OrdinalIgnoreCase) && string.IsNullOrEmpty(rootButton.key))` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Common.cs, src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs:341— `subSubButton.type.Equals("CLICK", StringComparison.OrdinalIgnoreCase) && string.IsNullOrEmpty(subSubButton.key)` appears character-identically in 2 files — src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu/CommonApi.Menu.Common.cs, src/Senparc.Weixin.Work/Senparc.Weixin.Work/CommonAPIs/CommonApi.Menu.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Documentation: no installation or build instructions README.md— 文档中没有安装/构建或依赖配置说明,仅展示了一个快速上手的命令行入口但未指导如何从源码获取和编译。 补充安装步骤:通过NuGet安装所有版本包(.NET Framework、.NET Standard 2.x、.NET 6.0+),以及本地构建/打包为vsix的完整指令。
Documentation: no usage examples README.md— 文档中没有实际的使用示例,仅有一个快速上手的命令行入口和一个AI助手侧栏查询指引,无法验证代码是否正确调用接口。 添加至少两个完整代码片段:公众号模板消息发送、小程序用户信息获取,并说明如何从AI助手跳转到文档中。
Documentation: no architecture or design documentation README.md— 没有架构/设计文档,仅在项目文件夹说明和模块列表中列出Senparc.Weixin.Work.Middleware等子库,但缺少整体架构图或组件交互描述。 补充架构概述:各平台SDK的依赖关系、消息处理流程、缓存扩展方案(Memcached/Redis)的集成方式。
Fat interface: ISenparcWeixinSettingForTenpayV3 (18 members) src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs:163— `ISenparcWeixinSettingForTenpayV3` declares 18 members: `TenPayV3_MchId`, `TenPayV3_SubMchId`, `TenPayV3_Key`, `TenPayV3_CertPath`, `TenPayV3_CertSecret`, `TenPayV3_AppId`, `TenPayV3_AppSecret`, `TenPayV3_SubAppId`, `TenPayV3_SubAppSecret`, `TenPayV3_TenpayNotify`, `TenPayV3_PrivateKey`, `TenPayV3_SerialNumber`, `TenPayV3_APIv3Key`, `TenPayV3_TenPayPubKey`, `TenPayV3_TenPayPubKeyID`, `TenPayV3_TenPayPubKeyEnable`, `TenPayV3_WxOpenTenpayNotify`, `EncryptionType`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (via [Authorize]/guards) — this is NOT a claim that endpoints are unprotected. What's missing is NAMED policies (AddAuthorization/AddPolicy, RequireRole/RequireClaim, RequireAuthorization): the access rules are implicit rather than named and testable. Recommendation, not a defect — name the rules so they're reviewable.
C5 · Data-Subject Rights· Partial data-subject-rights support · ×1
Partial data-subject-rights support — Corroborated rights: erasure ✗ · export ✓ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.
No ADRs found — 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/`.
D21 · Naming Consistency· Inconsistent casing and versioning in the TenPay namespace · ×1
Inconsistent casing and versioning in the TenPay namespace: 'TenPay' (PascalCase) vs 'Tenpay' (camelCase) and 'V2'/'V3' vs 'V3' embedded in names. Specifically, `TenpayV3ProfitShareingAddReceiverRequestData` uses lowercase 'p' in 'Tenpay' and misspells 'Sharing' as 'Shareing', while other types use 'TenPay' or 'TenPayV3'. — Standardize to 'TenPay' (PascalCase) and correct 'Shareing' to 'Sharing'. Use consistent versioning suffixes (e.g., always 'TenPayV3' or always 'TenPay.V3'). (symbols: Type: public Senparc.Weixin.TenPay.V2.TenPay, Type: public Senparc.Weixin.TenPay.V3.TenPayV3UnifiedorderRequestData.SignType, Type: public Senparc.Weixin.TenPay.V3.TenpayV3ProfitShareingAddReceiverRequestData.Key, Method: private Senparc.Weixin.TenPay.V3.TenPayV3.CheckValidationResult(object, System.Security.Cryptography.X509Certificates.X509Certificate, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors))
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 6 of 35 project(s) overshoot their size bounds, lowering Project Cohesion to 6.7/10. The most over is `Senparc.Weixin.Work.net10(net462)` (72505 LoC, 2535 public types across 81 namespaces). Review these for cohesion — split a project that spans unrelated responsibilities.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 216 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/CreateProfitsharingReturnJson.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Complaint/Entities/ReturnJson/QueryComplaintsReturnJson.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/CombineTransactionsRequestData.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/VehicleParking/Entities/RequestData/PayParkingRequestData.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Marketing/Entities/NotifyJson/BusifavorNotifyJson.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/ReturnProfitsharingReturnJson.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/RequestData/CreateProfitsharingRequestData.cs, src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/Entities/ReturnJson/QueryReturnProfitsharingReturnJson.cs (and 208 more) (249 orphaned of 1098 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1098 of the 1905 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
ED5 · Idempotency· Possible non-idempotent mutation (review) · ×1
Possible non-idempotent mutation (review): WebSocket.CustomNetCoreWebSocketMessageHandler.OnMessageReceiced Samples/All/Senparc.Weixin.Sample.CommonService/MessageHandlers/WebSocket/CustomNetCoreWebSocketMessageHandler.cs:31— `WebSocket.CustomNetCoreWebSocketMessageHandler.OnMessageReceiced` mutates persistent state (a repository write one hop away, in SessionContainer.GetSession) with no visible idempotency guard. Under a client retry or at-least-once redelivery a re-run could double-apply it — confirm it's safe to re-run, or add an exists/dedup check, an upsert, an idempotency-key/inbox, or a versioned write.
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.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 27531/27782 types (99%) are public. For a library, every public type is a stability contract — make internal-by-default and expose only the intended API.
Logging is not universal — Only 8/27 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 27, 8 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 13936 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
PF1 · Benchmark discipline· No performance benchmarks · ×1
No performance benchmarks — No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 50/1634 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Nullable reference types not enabled everywhere — 8/12 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Hand-rolled JSON/XML parsing via regex Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10/Controllers/Weixin/MP/MenuController.cs:52— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan
Run 01a0cc72-a2d0-73e5-a548-e7eeb7b0dc69 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Appendix C — Personal-data map
Every field, property and record parameter whose name is conventional personal data — 213 field(s) across 5 categories, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by NAME, from the C# syntax tree, with a deliberately specific identifier classifier — the same one the C1–C5 compliance cards use to decide whether personal data is present, so CardDefinition or FileName don't trip. Two caveats stated rather than glossed: those cards additionally require corroboration (a persistence/account signal, or two distinct PII categories) that this inventory deliberately does not, so it lists more than they gate on; and D32 Data Compliance shares nothing with it — that dimension is a separate semgrep ruleset for personal data leaking into logs, URLs and browser storage, and a clean D32 result says nothing about this list. Informational — it feeds no score.
Issues: 134 · Warnings: 1355 · Recommendations: 74 · Info: 58 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 23-09-2026 @ 04:07 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.